Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Learning to play with updateable views
Message
De
23/05/2003 06:20:41
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Learning to play with updateable views
Divers
Thread ID:
00792114
Message ID:
00792114
Vues:
80
I have ploughed through 400 messages mentioning View update problems and none seem to deal with my current problem.

I have two nearly identical situations involving updateable parameterised views.

One works, the other doesn't. I have reduced the scope of the problem to the creation of new primary keys.

The one WITHOUT a primary key works! (it has a field nominated as Key for the purposes of the view)

I should point out that the failures only occur on the addition of new records within the view. Amendments to existing records are correctly updated in both views. (Which reassures me that I have the basic setup right, keys selected, sql update selected etc)

If I experiment with permutations of key arrangements I get the following errors from Tableupdate() after I try to Save:

With the key I want to use - an Autoincrementing integer - I get "Uniqueness violated" (1884).
(despite the fact that the autoincrement counter is correctly incrementing: Its as though the tableupdate is attempting to insert the new record before the counter is incremented, fails, and Then increments the counter)

If I switch off the unique requirement in the index, the failure is "Record is not locked (130)" (on a standalone workstation).

If I add a similar key to the table whose views are updating correctly I experience similar errors with updating new records, with the addition of "Record is in Use (1502)".

I have allowed the default buffering which is level 3 (optimistic Row)

Codewise, I'm using the txtbutton class that comes with vfp 8. Its "updaterows" method traps the errors. The only amendment I've made to the code is to add a few more defined error conditions so I can see whats happening in real time.

Suggestions?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform