Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Uniqueness of index failed with append blank...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00267107
Message ID:
00267122
Vues:
17
>>I am using an append blank command followed by replace ident with oSession.get_unique_id. It works fine most of the time but if there is a failure somewhere, I have a record with 0 in the ident field and then of course the next user trying to add fails with a uniqueness of index blabla error.
>
>One way to get around this is to put the call to your unique id routine in the default setting for the field. You can then issue an APPEND BLANK with no problems.
>
>>I wonder: If I use an INSERT SQL command with ident=oSession.get_unique_id(), will it create the record with the proper ident without going through a 0?
>
>INSERT SQL is another alternative. Works well.
>
>>Second question: After an INSERT SQL, will the current record always be the good one ? Can I perform some replace on it if need be just after ?
>
>Not sure what you mean.

Thanks Evan for the tip.

The second question is: When you perform an insert sql, let's say that after it you have some code that need to change one of the record field. After the insert, will the inserted record be currently pointed? If it is the case, it means that you can just perform a replace on it I guess.

ALso: In my application, I did put the forms as optimistic buffered mode. When I do a change, I perform a tableupdate(2,.T.). With an insert, do I still have to perform the tableupdate to write the change in the database or is it done directly ?

Thanks a lot
Eric
Eric Crespin
Consultant
PC PLUS Software Inc.
www.pcplus.ca
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform