Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>>>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement