Solved

I can't get the Crystal 10 viewer to switch databases.  SQL 2000, Crystal, VB 6.0, CRAXDRT

Posted on 2007-03-30
10
356 Views
Last Modified: 2007-12-19
I can't get the Crystal 10 viewer to switch databases.  I have some code below that worked with the CRAXDRT.dll library in Crystal 8.5.  I commonly have to fire a crystal reports that are pointed at SQL servers and usually use either OLEDB or ODBC as it's connection.  I am always having to test a crystal report agains a test database, and then copy this crystal report into a production environtment.   Since the software we support moved to crystal 10 (yeah I know that was a while ago...) I haven't been able to get the craxdrt library to actually switch databases.  It just continues to point at the database that was used to develope the crystal report.

Below is the boiled down VB 6.0 code I use:

Public pbReport As CRAXDRT.report
Public Sub RunReport(ByVal PnFileNameIN As String)
Dim report  As New CRAXDRT.report
Dim crxApplication As New CRAXDRT.Application
Dim crxDatabase As CRAXDRT.Database
Dim crxDatabaseTable As CRAXDRT.DatabaseTable

Set report = crxApplication.OpenReport(PnFileNameIN, 1)

For Each crxDatabaseTable In report.Database.Tables
' FOR ODBC
crxDatabaseTable.SetLogOnInfo "ODBC datasource name", Database, "<<Use Integrated Security>>"
' FOR OLEDB
crxDatabaseTable.SetLogOnInfo server, Database, user, pwd
Next crxDatabaseTable
Set pbReport = report
' frmprint uses PBreport as it's reportsource
frmprint.Show

End Sub

0
Comment
Question by:rskuya
  • 5
  • 2
10 Comments
 
LVL 17

Expert Comment

by:MIKE
ID: 18827129
And just to verify...these databases are on DIFFERENT servers....correct?

MikeV
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18827324
Is data saved with the report?

mlmcc
0
 

Author Comment

by:rskuya
ID: 18837318
To answer both of your questions, the Data is not saved with the report,
and the Server remains the same, only the Database changes.  

In addition, the user has dbo access to both databases.  
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:rskuya
ID: 18876106
Anyone have any ideas, or similar experience? I bumped up the points hoping someone would take a renewed interest.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18876592
0
 

Author Comment

by:rskuya
ID: 18876931
I looked for the TableLogOnInfo method in the CRAXDRT library, as it seems to be the focal point of the two examples you provided, but I could not find it.  Is there another library I should be referencing, or did you have any luck finding a VB 6 example?  I'm somewhat trapped in VB 6 era technologies for a while, so .net solutions don't usually help.

Thanks for any help!
0
 

Author Comment

by:rskuya
ID: 18891373
Bump the points up.  Any one have any other ideas...
0
 

Accepted Solution

by:
rskuya earned 0 total points
ID: 18893551
No worries everyone.  Sorry to say, but I must give credit to Tek-tips.com and the 2005 addendum found at the bottom of this posting:
http://www.tek-tips.com/faqs.cfm?fid=5374

Problem solved
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how the fundamental information of how to create a table.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question