Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updatable SQL Cursor
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00517826
Message ID:
00517841
Views:
20
Donald,
In order to make a SQL passthrough cursor updatable, you have to set a few properties. Try the following against the northwind customers table:
?SQLEXEC(lnSql, "SELECT customerid, companyname FROM customers", "customers")
=CURSORSETPROP("Tables", [dbo."customers"])
=CURSORSETPROP("UpdateNameList", [customerid dbo."customers"."customerid", companyname dbo."customers"."companyname"] )
=CURSORSETPROP("KeyFieldList", "customerid" )
=CURSORSETPROP("UpdatableFieldList", "customerid companyname" )
=CURSORSETPROP("SendUpdates", .t.)
REPLACE companyName WITH UPPER(companyName)
?TABLEUPDATE()
?SQLEXEC(lnSql, "SELECT customerid, companyname FROM customers", "customers")
BROW
HTH

>I'm not even sure how to phrase this question. When I am in a Project I can make a connection to a SQL database. I can then use that connection when creating a Remote View. In the process of creating that Remote View I can select the unique field of the table and those fields that I want to have as updatable. This is all visual and it works. Now I would like to be able to do the same thing programmatically and I have no idea how to do it. I can make the connection, no problem. I use the SQLExec() to select the data to a cursor, but it is not updatabe.
>
>Basically I want to change a field in the Remote View and have that change updated automatically in the SQL Table. Can anyone point me in the correct direction?
>
>TIA
>DJ :o)
Daniel
Previous
Reply
Map
View

Click here to load this message in the networking platform