Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trouble updateing related views
Message
De
19/11/1999 19:58:56
Jill Derickson
Software Specialties
Saipan, CNMI
 
 
À
19/11/1999 18:23:58
Jill Derickson
Software Specialties
Saipan, CNMI
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00293352
Message ID:
00293372
Vues:
22
I'm learning more about my problem.

CSN has a primary key, iCSNID, that is generated from a call to GetKey("CSN") as the default value.

ClientConditions includes a foreign key field that should match the parent record, iCSNID.

For new records, how can I retrieve the new value so that I can use it in ClientConditions, and have the whole thing wrapped in a transaction?

I'd thought that I'd call GetKey in the View, so that when I INSERTed a record, I'd have the value to use in ClientConditions. But it looks like when the TableUpdate to CSN is called, the key value is not updated...
- if CSN does not have the default of GetKey() a 0 value is used
- if CSN DOES have the default of GetKey, a NEW value is used

In any case, when I try to TableUpdate ClientConditions, I get a failure, I think, because the correct key value is not in CSN.

Help is appreciated...J


>I have data in a parent table, CSN (clients), and related records in ClientConditions (medical conditions). When a new client is entered, I want
>to require at least one condition. I want to update the tables with views (table buffered).
>
>The main form updates CSN records. In another, modal form (w/default data session), called from the main form, the user chooses the entries for ClientConditions.
>
>So i have an UpdateCSN view and an UpdateClientConditions view. I wrap the updates in a transaction, updating UpdateCSN first, then UpdateClientConditions. The update of UpdateClientConditions fails (I've checked out the view in interactive mode and the update works fine).
>
>I can add more details, but I just found the following in the Hacker's Guide (under TableUpdate):
>
>"In later versions of VFP, failing to either commit or revert changes before closing a form is the same as reverting the changes."
>
>Does this mean that a tableRevert will be done when I exit the modal form and then when I do the transaction, the TableUpdate will fail for that reason?
>
>Obviously I'm confused. Input is appreciated.
>
>J
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform