Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is the proper syntax?
Message
De
22/04/2003 09:50:31
 
 
À
22/04/2003 09:43:52
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00780103
Message ID:
00780106
Vues:
13
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform