lcorriveau
Programmer
I have the following code associated to an MS Access button on a form. It works fin for an SQL Datasource, but can't get it to connect to an Oracle Datasource. I keep getting the message: Cannot Open SQL Server.
I am using Crystal 7.0.
Dim crpApplication As New CRPEAuto.Application
Dim crpReport As New CRPEAuto.Report
Dim crpExportOptions As New CRPEAuto.ExportOptions
Dim crpTable As CRPEAuto.DatabaseTable
Function ExportRepportRTFOra(ReportName As String, FileName As String)
Set crpApplication = CreateObject("Crystal.CRPE.Application"
Set crpReport = crpApplication.OpenReport(ReportName, 1)
Set crpExportOptions = crpReport.ExportOptions
crpReport.DiscardSavedData
crpReport.Database.Tables(1).SetLogOnInfo "Datasource name", "Service Name", "login", "pass"
crpExportOptions.Reset
crpExportOptions.DestinationType = crEDTDiskFile
crpExportOptions.DiskFileName = FileName
crpExportOptions.FormatType = crEFTRichText
crpReport.PrintWindowOptions.HasCancelButton = True
crpReport.EventInfo.ActivatePrintWindowEventEnabled = True
crpReport.ProgressDialogEnabled = True
crpReport.Export False
Set crpReport = Nothing
End Function
Any ideas on how I can make this work are welcome !
Thanks,
Louis
I am using Crystal 7.0.
Dim crpApplication As New CRPEAuto.Application
Dim crpReport As New CRPEAuto.Report
Dim crpExportOptions As New CRPEAuto.ExportOptions
Dim crpTable As CRPEAuto.DatabaseTable
Function ExportRepportRTFOra(ReportName As String, FileName As String)
Set crpApplication = CreateObject("Crystal.CRPE.Application"
Set crpReport = crpApplication.OpenReport(ReportName, 1)
Set crpExportOptions = crpReport.ExportOptions
crpReport.DiscardSavedData
crpReport.Database.Tables(1).SetLogOnInfo "Datasource name", "Service Name", "login", "pass"
crpExportOptions.Reset
crpExportOptions.DestinationType = crEDTDiskFile
crpExportOptions.DiskFileName = FileName
crpExportOptions.FormatType = crEFTRichText
crpReport.PrintWindowOptions.HasCancelButton = True
crpReport.EventInfo.ActivatePrintWindowEventEnabled = True
crpReport.ProgressDialogEnabled = True
crpReport.Export False
Set crpReport = Nothing
End Function
Any ideas on how I can make this work are welcome !
Thanks,
Louis