Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with CR9 Set database connection

Status
Not open for further replies.

EzriR

Programmer
Jul 31, 2000
2
IL
Hi
I have a VB6 wizard application that allows my users to run existing reports and create new reports.
My user's databases are identical with my development database except the server name and database name(MS-SQL server).
The proble is that I can't make the reports run on databases with different server and database names.

Here is the code that I use for ODBC connection:

For Each crDBTable In crDBTables
Set CPProperty = crDBTable.ConnectionProperties("User ID")
CPProperty.Value = "U_SMARTLOG"

Set CPProperty = crDBTable.ConnectionProperties("Password")
CPProperty.Value = "xxxxxxxxx"

Set CPProperty = crDBTable.ConnectionProperties("DSN")
CPProperty.Value = "SmartLog"

Set CPProperty = crDBTable.ConnectionProperties("Database")
CPProperty.Value = SelectedReport.DatabaseName
Next

Here is the code that I try to use for OLE DB Provider connection:

For Each crDBTable In crDBTables
Set CPProperty = crDBTable.ConnectionProperties("Data Source")
CPProperty.Value = SelectedReport.ServerName

Set CPProperty = crDBTable.ConnectionProperties("Initial Catalog")
CPProperty.Value = SelectedReport.DatabaseName

Set CPProperty = crDBTable.ConnectionProperties("User ID")
CPProperty.Value = "U_SMARTLOG"

Set CPProperty = crDBTable.ConnectionProperties("Password")
CPProperty.Value = "xxxxxxxxxxx"
Next

Am I missing something?

Thanks for the help.

Robert




Robert Ezri
robert@idioma.co.il
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top