Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Am I misusing TableUpdate()?
Message
 
To
12/09/1999 15:36:21
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00261437
Message ID:
00263855
Views:
35
>>>>All of the fields are set in the view as updatable (even the primary key field), and when creating a new record things now insert kind of OK. However, if I edit a record, VFPODBC complains "uniqueness of primary key violated" when I know it hasn't been. It's like although I am doing a
>>>

>have you chekced the value of the primary keyfield in the view just beforethe TABELUPDATE()?

The keyfield value in the view is the same as what's in the originating VFP table. My (feeble) understanding of tableupdate() was that it would use the index value to locate the matching table record and then overwrite that with the new data. What's weird is that when I changed my "keyfield" from a primary index to a regular index, the following code basically inserts a new record is exactly like the one I was editing. All I get is inserts, no updates.

Here's the code:
select CustUpdate
tableupdate(2,.t.,alias(),arNotUpdate)
use OrigDBC!CustUpdate nodata
ThisForm.Refresh

In the VFP Tools->Options->Remote Data tab:
SQL Updates criteria: Key Fields Only
Method: SQL Update

This is maddening. I must re-use the same primary key, I am updating/overwriting customers which already have a unique number (I can't regen a new customer number every time something gets modified).


Is it just impossible to use tableupdate on VFP tables?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform