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
351 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
 

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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how the fundamental information of how to create a table.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now