Incrementing Record No 
Author Message
 Incrementing Record No

Hi Phil,

Create a AutoNo Table and PoolNo Table.

Generate the AutoNo from the AutoNo each time adding 1 to the existing.

In cases where you press insert and decided to cancel, save the number into
the PoolNo.  The next time, before you generate a number from the AutoNo
Table, loop through the PoolNo to make sure that similar number are being
recycled.  I had been using this in a 34 users enviornment without any
problem.

In such case that they delete a record, you can base on a global variable to
decide whether you want to throw the number back to the PoolNo table to be
cycled.

Thanks.

Kelvin Chua
SINGAPORE


Quote:
> I have several files in my dictionary whose primary key is an auto-
> incrementing LONG RecordNo. My question is when I am creating a new
> record in embedded code, how do I increment the RecordNo (or reuse a
> deleted one)? I could always SET to the end of the file and GET previous
> and add 1 to that RecordNo but that seems crude, inefficient and possibly
> fraught in a multi-user situation. Must be a better way. TIA.

> Phil Lancaster



Mon, 22 Mar 2004 06:31:40 GMT  
 Incrementing Record No
I have several files in my dictionary whose primary key is an auto-
incrementing LONG RecordNo. My question is when I am creating a new
record in embedded code, how do I increment the RecordNo (or reuse a
deleted one)? I could always SET to the end of the file and GET previous
and add 1 to that RecordNo but that seems crude, inefficient and possibly
fraught in a multi-user situation. Must be a better way. TIA.

Phil Lancaster



Sun, 21 Mar 2004 15:21:21 GMT  
 Incrementing Record No
Phil,
check out "primeautoinc" in the help.  Should help get you on the right
track.
Cheers!
Dave Beggs

Quote:
> I have several files in my dictionary whose primary key is an auto-
> incrementing LONG RecordNo. My question is when I am creating a new
> record in embedded code, how do I increment the RecordNo (or reuse a
> deleted one)? I could always SET to the end of the file and GET previous
> and add 1 to that RecordNo but that seems crude, inefficient and possibly
> fraught in a multi-user situation. Must be a better way. TIA.

> Phil Lancaster



Sun, 21 Mar 2004 15:26:50 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Prime record fields on insert - Before adding auto incremented record

2. Auto increment record

3. Writing an auto-incremented record

4. Problem with adding an auto-incremented record

5. Spin Box increments less than 1- from .0153 to .98438 w/.0153 increment changes

6. Convert comma-delimited records to fixed length records

7. Deleting current record based on next record

8. Records Disappeared/Added to the prior Record No

9. Records with a record # of zero problem

10. C5EEa - Record Not Available(33) when deleting a record

11. Add Child Record Within New Parent Record form.

12. Record Date and Time Record Updated

 

 
Powered by phpBB® Forum Software