Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Am I misusing TableUpdate()?
Message
 
À
12/09/1999 15:36:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00261437
Message ID:
00263855
Vues:
34
>>>>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?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform