Exporting Crystal Crax through VB

CarlH
05-19-2005, 07:00 AM
I am desperate on this:

I have reports that are linked to access databases.
Providing the Report has been converted to a DAO database driver through the Crystal Reports IDE, the following code works fine:


Dim appl As CRAXDRT.Application
Dim rep As CRAXDRT.Report
Dim tbl

Set appl = New CRAXDRT.Application
Set rep = appl.OpenReport(ReportFileName, 1)

For Each tbl In rep.Database.Tables
tbl.Location = DBFileName
Next tbl

rep.DiscardSavedData
rep.ExportOptions.DiskFileName = OutputFileName
rep.ExportOptions.DestinationType = 1
rep.SQLQueryString = SQLString
rep.ExportOptions.FormatType = crEFTExactRichText
rep.ExportOptions.RTFExportAllPages = True
rep.ExportOptions.UseReportDateFormat = True
'rep.Database.Tables(1).Location = DBFileName
rep.Export False
Set rep = Nothing
Set appl = Nothing

However, I need the reports to be converted to OLEDB so I can switch from reporting through an Access database to reporting through SQL Server.

After converting the Reports to an OLEDB Database Driver, the code above no longer works, even though it still is a MS Access Database.

I believe I will have to use:
rep.Database.LogOnServer "pdsoledb.dll", "Microsoft.Jet.OLEdb.4.0;", "C:\CPass\Data\Pass2Copy_ecristal.mdb", "", ""

BUT... it does not work. PLEASE PLEASE help me or shoot me.

Ta.

Carl. :)

ashish908
06-18-2005, 04:58 AM
What error does it give?

MKoslof
06-22-2005, 06:47 PM
Not sure I follow the question. If you are using CRAXDRT, you are implementing an ACTIVE X RUNTIME Library. The RDC and the CRAXDRT objects are based off of ADO. You can connect to your database via ADO from VB, and instantiate a recordset and pass it to your CRAXDRT objects..DAO really isn't a factor.

What were the reports DESIGNED with? Meaning, what database driver did you select when creating the reports.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum