Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the proper syntax?
Message
From
22/04/2003 09:50:31
 
 
To
22/04/2003 09:43:52
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00780103
Message ID:
00780106
Views:
14
>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~VFP
http://fox.wikis.com/wc.dll?Wiki~CategoryADO


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform