Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with Crystal
Message
De
14/10/2008 11:34:48
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Crystal Reports
Titre:
Help with Crystal
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01354850
Message ID:
01354850
Vues:
92
We are adding some Crystal reports to our Visual FoxPro 8 application. We have been having problems with running a report more than once. We get a message indicating that the OLE object may be corrupt. I tracked it down to the SetDataSource method on the Table from the Crystal Report. After more investigation I found CRDB_ADOPLUS.DLL never gets unloaded until VFP is closed.

I have attached code that exhibits the symptom. The report was created with Crystal 9 and just selects * from one of our tables, no formatting just used the default layout from Crystal.

This issue only occurs on a machine that gets the Crystal 9 Runtime loaded via the merge modules I got from the SAP site. If it is run on a machine that has Crystal 9 Developer Edition loaded, it works fine. The difference is that on the machine with the full Crystal 9, CRDB_ADOPLUS.DLL is never loaded, but on the machine with just the Crystal 9 Runtime it does get loaded and never gets unloaded. It gets loaded during the call to SetDataSource.

Any help would be appreciated.

Thank you in advance.
LOCAL oCR AS CRAXDRT.Application
LOCAL oRpt AS CRAXDRT.Report
LOCAL oDB AS CRAXDRT.Database
LOCAL ocDBT AS CRAXDRT.DatabaseTables
LOCAL oDBT AS CRAXDRT.DatabaseTable
LOCAL oConn AS ADODB.Connection
LOCAL oRS AS ADODB.Recordset
LOCAL oExp as CRAXDRT.ExportOptions

set deleted on

oConn = CREATEOBJECT("ADODB.Connection") 
oConn.ConnectionString = "Provider=VFPOLEDB.1;Data Source=c:\metacomet\data\royalty.dbc;Password=''" 
oConn.Open() 
oRS = CREATEOBJECT("ADODB.RecordSet") 
oRS.Open('select * from options',oConn)

oCR = CREATEOBJECT("CrystalRuntime.Application")

oRpt = oCR.OpenReport("options.rpt")

oDB = oRpt.Database()

ocDBT = oDB.Tables()

oDBT = ocDBT.Item(1)

oDBT.SetDataSource(oRS) && Error occurs on this line on second execution

oExp = oRpt.ExportOptions()

oExp.DestinationType = 1  && crEDTDiskFile

oExp.FormatType = 29  && crEFTExcel70

oExp.ExcelUseConstantColumnWidth = .f.

oExp.DiskFileName = getfile('xls','Choose location to save file','Open',0,'Save Report')

if !EMPTY(oExp.DiskFileName)
	orpt.Export(.F.)
ENDIF

oRS.close()
oConn.Close()
oRS = .null.
oConn = .null.

oexp= .null.
odbt= .null.
oDB = .null.
ocdbt = .null.
odb = .null.
oRpt = .null.
ocr = .null.

return
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform