Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remote View Data Duplication
Message
De
10/12/2023 20:30:45
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
 
 
À
09/12/2023 23:48:52
Kato Ba
Bytex Technologies Limited
Kaduna, Nigéria
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01687405
Message ID:
01687415
Vues:
47
Hello,

>>My program establishes a connection with an SQL Server database and utilizes a remote view. The issue arises when I fill the remote view cursor with data and issue a >>TableUpdate. Instead of updating the existing records as expected through the primary key, they are being inserted again as new records. Please what am I doing >>wrong?

Duplicates suggest that cGuid is not a primary or candidate key in the underlying table, or else duplicates would not be possible.

The RV query should return existing row/s with cGuid that matches gckey1. Editing an existing row will yield 1 and 2 in GETFIELDSTATE(-1). If you are seeing 3 and 4 in GETFLDSTATE(-1) then these are appended records, not edited records. This suggests the query is not returning existing records, so the app adds another.

Just for completeness- if the RV returns row/s you update or replace values in the existing record rather than appending, correct?

If so, then I would suggest:
- cGuid needs to be made primary or candidate key in the database.
- check the value of gckey1 if it is not returning records that you know exist. Look for leading/trailing spaces, or length >15 chars.
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform