PaulPattinson
asked on
Changing Connection parameters in a Crystal 11 report
I have a crystal 11 report, running from a SQL server stored procedure.
I am using VB6 code to run the report.
I am using CRAXDDRT in the VB6 project.
I am using the ConnectionProperties of the table to set the security, server and initial catalog.
the problem is, if I want to change the name of the SQL server database (for upgrading purposes), the report still attempts to connect to the old database name.
This is causing a problem because if the original database does not exist the program will not run.
Any ideas?
I am using VB6 code to run the report.
I am using CRAXDDRT in the VB6 project.
I am using the ConnectionProperties of the table to set the security, server and initial catalog.
the problem is, if I want to change the name of the SQL server database (for upgrading purposes), the report still attempts to connect to the old database name.
This is causing a problem because if the original database does not exist the program will not run.
Any ideas?
ASKER
Yes. It has 3 subs.
ASKER
The subreport connection properties are being set using the same logic as the main report.
Can you show the code?
mlmcc
mlmcc
ASKER
This is the code i am using to set the connection paramrters for each table in the report/subreports :
I took this from the Crystal Reports Technical reference guide . pdf
Private Sub SetTableLogonInfo(i_objRep ortTable As CRAXDDRT.DatabaseTable)
Dim objConnectionProperty As CRAXDDRT.ConnectionPropert y
Dim strLocation As String
Set objConnectionProperty = i_objReportTable.Connectio nPropertie s("Integra ted Security")
objConnectionProperty.Valu e = True
'Get the Datasource Property of the Table and set it with the server name
Set objConnectionProperty = i_objReportTable.Connectio nPropertie s("Data Source")
objConnectionProperty.Valu e = m_strServerName
'Get the Initial Catalog Property of the Table and set it with the database name
Set objConnectionProperty = i_objReportTable.Connectio nPropertie s("Initial Catalog")
objConnectionProperty.Valu e = m_strDatabaseName
Exit Sub
I took this from the Crystal Reports Technical reference guide . pdf
Private Sub SetTableLogonInfo(i_objRep
Dim objConnectionProperty As CRAXDDRT.ConnectionPropert
Dim strLocation As String
Set objConnectionProperty = i_objReportTable.Connectio
objConnectionProperty.Valu
'Get the Datasource Property of the Table and set it with the server name
Set objConnectionProperty = i_objReportTable.Connectio
objConnectionProperty.Valu
'Get the Initial Catalog Property of the Table and set it with the database name
Set objConnectionProperty = i_objReportTable.Connectio
objConnectionProperty.Valu
Exit Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
NOt sure either unless there is some difference in a connection to an SPP when compared to a view or table.
mlmcc
mlmcc
mlmcc