|
-
Sep 11th, 2006, 12:49 PM
#1
Thread Starter
New Member
Changing database at runtime yields same data
Hi, I am using VB6 (code below), CR11, MSSQL 2000. When I change the database, data is still pointing to the 1st db and Save Data with Report is not checked. No subreport.
With crReport.Database
For i = 1 To .Tables.Count
.Tables(i).SetLogOnInfo g_Server, g_Database, g_User, g_Pwd
Next
End With
In CR11, if I open the report, do Verify Database and change the db there, it also doesn't work because data is still pointing to the old db. When I look at the properties in Set Database Location, the connection properties show Initial Catalog pointing at the new db but the table's properties show that the Catalog still pointing to the old db.
Please help. Thanks.
-
Sep 28th, 2006, 04:03 AM
#2
New Member
Re: Changing database at runtime yields same data
I have exactly the same problem...
-
Sep 28th, 2006, 06:33 AM
#3
New Member
Re: Changing database at runtime yields same data
Here is the answer !!!
Dim crxapplication As CRAXDRT.Application
Dim crxsubreport As CRAXDRT.Report
Dim crxDatabaseTable As CRAXDRT.DatabaseTable
Set crxapplication = CreateObject("crystalruntime.application.11")
Set crxreport = crxapplication.OpenReport(PathReports)
For Each crxDatabaseTable In crxreport.Database.Tables
crxDatabaseTable.ConnectionProperties("Initial Catalog") = g_Database
crxDatabaseTable.ConnectionProperties("Data Source") = g_Server
crxDatabaseTable.ConnectionProperties("Integrated Security") = True
crxDatabaseTable.Location = crxDatabaseTable.Location
Next crxDatabaseTable
Thanx to Experts Exchange
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|