Link to home
Start Free TrialLog in
Avatar of PaulPattinson
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?
Avatar of Mike McCracken
Mike McCracken

Does your report have subreports?

mlmcc
Avatar of PaulPattinson

ASKER

Yes. It has 3 subs.
The subreport connection properties are being set using the same logic as the main report.
Can you show the  code?

mlmcc
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_objReportTable As CRAXDDRT.DatabaseTable)

Dim objConnectionProperty As CRAXDDRT.ConnectionProperty
Dim strLocation As String

        Set objConnectionProperty = i_objReportTable.ConnectionProperties("Integrated Security")
        objConnectionProperty.Value = True
       
    'Get the Datasource Property of the Table and set it with the server name
    Set objConnectionProperty = i_objReportTable.ConnectionProperties("Data Source")
    objConnectionProperty.Value = m_strServerName
   
    'Get the Initial Catalog Property of the Table and set it with the database name
    Set objConnectionProperty = i_objReportTable.ConnectionProperties("Initial Catalog")
    objConnectionProperty.Value = m_strDatabaseName
   
    Exit Sub
ASKER CERTIFIED SOLUTION
Avatar of PaulPattinson
PaulPattinson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
NOt sure either unless there is some difference in a connection to an SPP when compared to a view or table.

mlmcc