cancel
Showing results for 
Search instead for 
Did you mean: 

pass sql server connection at runtime, CR XI, VB 6

Former Member
0 Kudos

I have been developing Crystal reports since version 4 using VB3, VB5 and VB6 and Access databases. I had al the routines built to modify the Acces table locations at runtime for easy deployment to client systems.

Now I have built an application using VB6 and SQL Server 2005. I used the OLE DB (ADO) connection. I built my reports hard coded to my development database connection. Now at runtime on my client pc with a different database name my report fails. I have looped through the tables collection and set the ConnectBufferString to the local sqlserver connection string. I tried setting the data source to my ado connection string in the VB code. (CrystalReport.Database.SetDataSource adoP21, 3)

What I get on the runtime pc is a "Cannot find table xxxx, do you want to remove....?". When I answer no, it pops a message box indicating that it is trying to find the table with the database named on my development pc. Indicates that my overrides have not worked.

Any thoughts or sample code appreciated.

John

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Post your questions to the Development Forum

Former Member
0 Kudos

In my VB6 code, I am rebuilding the SQL Server connection properties for the datatables collection to the same connection that the VB code is using. When I fire the viewreport command it says that it can't find tables and references the table location from my development pc.

I'm at an impasse. Could the automatic Verify Database commands be getting me in trouble? I'm going to try that next. I need my reporting working by Friday. Getting nervous!!!

Thanks