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. :)
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. :)