Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp50 - Auto Numbering
Message
De
21/04/1997 13:48:05
 
 
À
21/04/1997 13:40:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00029060
Message ID:
00029134
Vues:
35
>>>>>I am trying to have new records AUTO NUMBER. My method
>>>>>is to index on a unique number field and add one number and that is the new number for the next record.
>>>>>Having problems like this...
>>>>>the first user adds a record and the computer issues a number 3, at the same time the second user adds a record and the computer issues a number 4. Then first user decides to abort and the second user saves.
>>>>>Now the second user has the number 4 for it's AUTO NUMBER and there is not a number 3 because the first
>>>>>use did not save. How can I best do a AUTO NUMBER system?
>>>>
>>>>The common way to create unique record id (number) is following:
>>>>1. System contains table 'Setup' with 2 fields: TableName C, Counter I.
>>>>2. When user requests for new record id, he runs procedure to:
>>>>- go to Setup and locate record by specific Tablename,
>>>>- lock this record (RLOCK),
>>>>- increment counter by 1,
>>>>- use ne counter for INSERT command,
>>>>- unlock Setup record.
>>>
>>>Also.. I can do all the above, but the first user may abort and the second user may save. What to do there? How about this...
>>>If first use aborts, then assign second user the first user's AUTO NUMBER?
>>
>>I have coded the AUTO NUMBERING... I am having problems...
>>When I append and I go get my next number, the first line of code says:
>> SELECT counter.dbf
>>
>>this works.. when I go to SAVE.. I have coded:
>> SELECT counter.dbf
>> etc..
>>
>>Debug stops me at the SELECT and says..
>>ALIAS NOT FOUND.
>>
>>The second time I say SELECT, I have problems.
>>I have add the new table that holds the counter to the database
>>and to the datavironment.
>
>Follow Dave's advice, please. If it will not help, check where you closed 'Counter'.


I did not CLOSE counter.dbf... I thought as long as I added counter.dbf to
the DATAENVIRONMENT, it would take care of closing everything for me.
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform