Information générale
Catégorie:
COM/DCOM et OLE Automation
Craig,
Here is a copy of my Visual FoxPro 5.0 program…
clea
*Create Crystal Report Writer application object
LCrwApp=Createobject('Crystal.CRPE.Application')
*Create Open report variable
LCrwRep=LCrwApp.OpenReport("\\Dp__NT\Dp_Work\admin\xics\statemnt\fed_sup\Archive\A.rpt")
*Create Database variable
LcrwDat=LCrwRep.Database
*Create Database Table variable
LcrwTab=LcrwDat.Tables
LcrwItem1=LcrwTab.Item(1)
Lname=LcrwItem1.Name
? Lname
LcrwItem1.SetLogOnInfo("Visual FoxPro Tables","repplan")
LB=LcrwItem1.TestConnectivity
? LB
*Create Database Table Item variable Again
LcrwItem2=LcrwTab.Item(2)
Lname=LcrwItem2.Name
? Lname
LcrwItem2.SetLogOnInfo("Visual FoxPro Tables","repsrc")
LB=LcrwItem2.TestConnectivity
? LB
LCrwRep.DiscardSavedData
Lver=LcrwDat.verify
*Create Export Options of the Open report variable
LCrwExp=LCrwRep.ExportOptions
LCrwExp.FormatType=4
LCrwExp.DestinationType=1
LCrwExp.DiskFileName='\\Dp__NT\Dp_Work\admin\xics\statemnt\fed_sup\Archive\CCCrtf.rtf'
LCrwRep.Export(.f.)
The first error message reads: “ODBC error[Microsoft][ODBC Visual FoxPro Driver]SQL: ‘Column ‘Name1’ is not found.”
(Column Name1 is the first field from repplan used in the report)
The second error message immediately following the first reads: “OLE IDispatch exception code 20527 from CPEAUT32:SQL server error”
I have also tried adding this line early on....
LCrwApp.LogonServer("p2sodbc.dll","")
I appreciate your help
Précédent
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