Help 
Author Message
 Help

I have a database where the counter keeps going out of synch when records
are deleted etc

Can anyone tell me how I can code the database to remove the counter field
and reinsert it into the table so the record counter is correct

Thanks

Andy



Mon, 24 Jul 2000 03:00:00 GMT  
 Help

Hi,

here's something I wrote up that might help....
If your table does not contain any records, simply compacting the database
again will set the Autonumber field back to 1.
 Another way would be to delete the AutoNumber field and re-insert it in the
table.

Now, if you already knew this and still want to have each autonumber field
in your table after Deleting records, then i'd suggest using a long field in
which you use Damx to fibd out highest existing id, add 1 to it and use that
as the new pk.

HTH

--
Just my $.001
Dev Ashish
---------------

:I have a database where the counter keeps going out of synch when records
:are deleted etc
:
:Can anyone tell me how I can code the database to remove the counter field
:and reinsert it into the table so the record counter is correct
:
:Thanks
:
:Andy
:
:



Mon, 24 Jul 2000 03:00:00 GMT  
 Help

Hi Andy,

Unfortunately, you can't do that directly.

The only work around is to create another counter field in the table and
delete the current one.  Of course, if this counter field is on the one
side of a one to many relationship with another table, this shouldn't be
done.

Also, if the table is empty (no records), compacting the database will
reset the counter value.

Quote:

> I have a database where the counter keeps going out of synch when records
> are deleted etc

> Can anyone tell me how I can code the database to remove the counter field
> and reinsert it into the table so the record counter is correct



Tue, 25 Jul 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. help,help,help,help,help,help,help,help,help,help,help,help,help,

2. Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,

3. Help, Help, Help, Help, Help, Help, Help, Help, Help, Help, Help, Help, Help, Help, Help, Help, Help,

4. HELP HELP HELP HELP HELP HELPHELP HELP HELPHELP HELP HELP

5. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

6. HELP HELP HELP HELP HELP HELP HELP HEL P HELP HE LP HELP HELP HEL P HELP HELP

7. Help Help Help Help Help Help !!!!!

8. HELP HELP HELP Set document name of print job from VB HELP HELP HELP

9. HELP HELP HELP Early Binding Excel 5.0 HELP HELP HELP

10. HELP HELP HELP HELP HELP

11. Help - Print - Help -Print - Help - Print - Help - Print - Help

12. help help help help help

 

 
Powered by phpBB® Forum Software