Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem Creating Updatable Cursor with SQL
Message
 
 
À
19/04/2000 11:41:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00361321
Message ID:
00361390
Vues:
18
The code below creates a local cursor that is in no way linked to the ODBC back end source. You explicitly have to issue another SQLExec commend with the changed value. Ex. SQlExec(lnHandle,"update customer set password = '" + clients.password + "' where cutomerID = '" clients.customerID + "'"). You would need to do this for every customer that you changed in your local cursor (probably using a SCAN...ENDSCAN).

Or you need to create a remote view in your database that does this automatically. See the VFP Help on creating Remote Views in Chapter 5. Updating Data with Views.

HTH.

>Why doesn't the following code work? The password field never gets updated on the backend.
>
>lnHandle=SQLCONNECT("SQLFiles")
>=SQLEXEC(lnHandle,"SELECT * FROM customer","clients")
>=CURSORSETPROP("Tables","customer","clients")
>=CURSORSETPROP("KeyFieldList","customerid","clients")
>=CURSORSETPROP("UpdatableFieldList","password","clients")
>=CURSORSETPROP("UpdateNameList","password customer.password","clients")
>=CURSORSETPROP("SendUpdates",.T.,"clients")
>=CURSORSETPROP("Buffering",5,"clients")
>select clients
>** browse and update password field on one record
>=tableupdate(1,.t.)
>use
>=SQLDISCONNECT(lnHandle)
>
>Thanks in advance for your help.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform