Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting thru Oracle Datasource

Status
Not open for further replies.

lcorriveau

Programmer
Apr 23, 2002
16
CA
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top