|
-
Oct 26th, 2005, 04:13 PM
#1
Thread Starter
New Member
Dynamic Database Linking - CR XI
Hi bros..
I am using CR XI. I designed a report and added test SQL Server 2000 database to view and test the report results. Now in my program, I have to connect to the database using a dynamic connection string.
e.g in deign I am using testdatabase. Once design is done, I have to conenct to the ProductionDatabase in my VB code.
Thanks for your urgent reply
-
Oct 27th, 2005, 12:51 AM
#2
Re: Dynamic Database Linking - CR XI
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
-
Oct 27th, 2005, 02:51 PM
#3
Thread Starter
New Member
Re: Dynamic Database Linking - CR XI
Sorry but its for Crystal 9. I need for XI.
I know I have to use Creport.LogOnServer method but its not working. It does not give me any error but displays the data of design time database.
Since all the tables and links are desinged, I don't want to delete all and redesign in my code. It sounds stupid.
I should be able to just logon to the desired server and thats it.
Right?
-
Oct 27th, 2005, 04:14 PM
#4
Re: Dynamic Database Linking - CR XI
 Originally Posted by tansarbh
I know I have to use Creport.LogOnServer method but its not working. It does not give me any error but displays the data of design time database.
Check that you're not saving data with the report. When designing a report, by default it saves the data with the report, which means that everytime you run the report you get the same original data.
Open your report in Crystal and have a look under the File menu and make sure that Save Data with Report is not checked.
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
-
Oct 28th, 2005, 07:53 AM
#5
Thread Starter
New Member
Re: Dynamic Database Linking - CR XI
 Originally Posted by pnish
Check that you're not saving data with the report. When designing a report, by default it saves the data with the report, which means that everytime you run the report you get the same original data.
Open your report in Crystal and have a look under the File menu and make sure that Save Data with Report is not checked.
Yeah, I am aware of that and its not checked. Right now, the only solution is to create two ODBC connections and change it every time I have to switch the databse....which sounds non professional....
Thanks.
-
Oct 28th, 2005, 09:37 AM
#6
Re: Dynamic Database Linking - CR XI
I would try the solution posted in the other tread anyway (even if it is for version 9). I don't think they have changed the connection properties from 9 to 11.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Sep 7th, 2006, 03:06 PM
#7
New Member
Re: Dynamic Database Linking - CR XI
Hi, I am having the same problem. VB6, CR11, SQL 2000. When I change the database, data is still pointing to the 1st db and Save Data with Report is not checked.
Dim crCrystal As New craxdrt.Application
Dim crReport As craxdrt.Report
Set crReport = crCrystal.OpenReport(g_CRReportPath)
crReport.DiscardSavedData
With crReport.Database
For i = 1 To .Tables.Count
.Tables(i).SetLogOnInfo g_Server, g_Database, g_User, g_Pwd
Next
End With
CRViewer.ReportSource = crReport
CRViewer.ViewReport
In fact, in CR11, if I open the report, do Verify Database and change the db there, it also doesn't work because 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.
In my code, I tried the code suggestion above ...Item("Database Name") = g_database but I get the error Subscript out of range.
Please help. Thanks.
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
|