>I want to open Advantage Database server ADT tables in VFP 7 using OLE DB. I am using the following code:>OConn = CREATEOBJECT("ADODB.Connection")
>
>OConn.ConnectionString = "Provider=Advantage OLE DB Provider; ;
> Data Source=c:\program files\TRK\CO0001 ; ;
> ServerType=ADS_LOCAL_SERVER; TableType=ADS_ADT;"
>OConn.Open()
>myc=SQLEXEC(oConn, "SELECT * from trdata","trdata")
>brow
>OConn.close()
>
>I do not know how to write the code to actually access the tables. The SQLEXEC statement does not work. Can anyone help me with this? Thanks!You should call the Execute method of the connection object, not use SPT as in your example. These are two different things.
Something like:
myc = "SELECT * from trdata"
oRS = OConn.execute(myc)
Then you would have the results in an ADO recordset.
For examples see:
http://fox.wikis.com/wc.dll?Wiki~UsingADO~VFPhttp://fox.wikis.com/wc.dll?Wiki~CategoryADO