ocDBT = oDB.Tables()
but I "thought" you had created the variable as an object before that assignment. I got confused by the VFP7 intellisense code because I have no idea about it... thought you were doing VB, so my apologies.>ocDBT = oDB.Tables()
>
>ocDBT = CREATEOBJECT("CRAXDRT.DatabaseTables")>>but that class is not found. So I tried
ocDBT = CREATEOBJECT("CrystalRuntime.DatabaseTables")>>which again failed. I searched the registry to see if I could determine the correct call but no luck.
LOCAL oCR AS CRAXDRT.Applicationis a VB syntax isn't it?
>>>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 >>> >>>* Handle the ADO stuff >>>oConn = CREATEOBJECT("ADODB.Connection") >>>oConn.ConnectionString = "Provider=VFPOLEDB.1;Data Source=C:\eFox\Data\tastrade.dbc;Password=''" >>>oConn.Open() >>>oRS = CREATEOBJECT("ADODB.RecordSet") >>>oRS.Open("Select * FROM Customer", oConn) >>> >>>oCR = CREATEOBJECT("CrystalRuntime.Application") >>> >>>oRpt = oCR.OpenReport("C:\EFox\ADO1.RPT") >>> >>>* Create the Database object >>>oDB = oRpt.Database() >>> >>>* Get a references to the DatabaseTables collection >>>ocDBT = oDB.Tables() >>> >>>* Get a reference to the DatabaseTable object for table 1 >>>oDBT = ocDBT.Item(1) >>> >>>* Pass the Record Set to Crystal Reports >>>oDBT.SetDataSource(oRS) >>> >>>IF oRPt.HasSavedData >>> oRPT.DiscardSavedData() >>>ENDIF >>> >>>oRpt.PrintOut() >>>>>>