Information générale
Catégorie:
Crystal Reports
Titre:
Using OLE DB with Crystal Reports 9
I have a Crystal report version 9 connected to a local table. The properties for the table are:
Database type: OLE DB (ADO)
Provider: VFPOLEDB
Data Source: c:\temp
The user id and password are both blank. I am not using a DSN. The report is ok in Crystal. The table connects without a problem.
I then attempt to run the report by instanciating an instance of the crystal object, setting the location of the table, then exporting the report.
* Open the CR engine
oEngineObject = CREATEOBJECT("CrystalRuntime.application.9")
* Open the report
oReport=oEngineobject.openreport("Reportname.rpt")
* Set the location of the table
oReport.Database.Tables.item[1].location = "full path of table"
* Export the report to a file
oReport.ExportOptions.DestinationType = 1
* Set the format
oReport.ExportOptions.FormatType = 1
* Set up disk file name
oReport.ExportOptions.DiskFileName = "File name for export"
* Export
oReport.Export(.f.)
The logic has always worked fine when working with Fox 2.x tables. Now, I am getting this error when executing the export method:
Exception Code 0 from the CR ActiveX Designer: Logon failed.
Details: ADO Error Code: 0x800300fb
Source: MS OLE DB Service Components
Description: The file is not a valid compound file...
I did notice that the data source in Crystal does read: OLE DB (ADO). Unlike in 8.5 OLE DB - without the (ADO). Is Crystal 9 going to enforce an ADO connection to be made from my VFP code?
Any ideas?
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement