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
352 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
create an aggregate function 9 36
SQL - Copy data from one database to another 6 20
Can > be used for a Text field 6 49
Sql server get data from a usp to use in a usp 5 16
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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

832 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