Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapter with SQL and parameter
Message
De
27/09/2004 10:08:21
 
 
À
23/09/2004 17:06:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00944961
Message ID:
00946243
Vues:
36
Ok this is what I have so far.
But it does not use the tableupdate(), what do i need to change to add that?
CLOSE DATABASES ALL 
CLEAR

customerid='ALFKI'

LOCAL oCA as CursorAdapter

oCA=CREATEOBJECT("CursorAdapter")
oCA.AddProperty("customerid",'ALFKI')
oCA.SelectCmd="select * from Northwind..Orders where customerID = ?this.customerid"
oCA.KeyFieldList = "OrderID"
oCA.UpdatableFieldList = "Customerid, employeeid, freight, orderdate, orderid"
oCA.UpdateNameList = "Customerid orders.customerid, employeeid orders.employeeid, "+ ;
   "freight orders.freight, orderdate orders.orderdate, orderid orders.orderid"
oCA.CursorSchema = "customerid c(5), employeeid i, freight y, orderdate d, orderid i"

LOCAL oConn as ADODB.Connection, oRS as ADODB.Recordset, oCom as ADODB.Command

oConn=CREATEOBJECT("ADODB.Connection")
oConn.Open("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Data Source=(local)")

oRS = CREATEOBJECT("Adodb.RecordSet")
oRS.ActiveConnection = oConn
ors.CursorType = 3
ors.CursorLocation = 3
ors.LockType = 3


oCom = CREATEOBJECT("Adodb.Command")
oCom.ActiveConnection = oConn

oCA.DataSourceType="ADO"
oCA.DataSource=oRS

?oCA.CursorFill(,,,oCom)
BROWSE

oCA.customerid='HILAA'

oCA.CursorRefresh()
BROWSE


USE
If I change data in cursor one then rerun the changes are there. But really want to use tableupdate to validate noone else has changed.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform