Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
NewID function under a transaction
Message
 
 
À
20/02/2001 11:36:27
Bryan Palmer
Ramtech Building Systems, Inc.
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00477644
Message ID:
00477687
Vues:
27
>I'm using a standard NewID function (pulled from "1001 Things/VFP") in my stored procedures. I've recently built a form that inserts a record into a table, and updates values in another table. I've enclosed these inserts/updates in a transaction. The newid function causes an error by opening the autoid table, and tries to force buffering on the table to 1. This creates an error. I've temporarily bypassed the error by placing an IF !(TXNLEVEL()>0) around the setbuffer command, but I don't think this is the best way to handle this problem.
>
>Should I explicitly open the autoid table and set my buffering off before starting my transaction? Is there another way around this, or is this the best answer?
>
>Thanks,
>Bryan

IMO, yes you should pre-open the table and set the buffering to 1. The NewID function should then check the buffering and if appropriate, it should not try to set it again. However, if not set appropriately and a transaction already exists, it should not return a value because it can't be guaranteed to be unique at that point.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform