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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
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.

856 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