Compact and Repair - Reset Autonumber field

Rob601

New member
Local time
Today, 12:44
Joined
Jan 26, 2004
Messages
5
I know it's possible, however unwieldy, to compact and repair a database in code, but I'm looking for a way to reset an autonumber counter and continue running code. Compact and repair won't work because it closes the database. Is there another way to reset the autonumber counter besides compact and repair?

Thanks!
 
Rob601 said:
I know it's possible, however unwieldy, to compact and repair a database in code, but I'm looking for a way to reset an autonumber counter and continue running code. Compact and repair won't work because it closes the database. Is there another way to reset the autonumber counter besides compact and repair?

Thanks!

Could you continue running the code when the db re-opens by setting a flag somewhere before compacting which is checked when the db opens. :)

Rob
 
Take a look at this post that tells you how to reseed an autonumber.

http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=45181

You should be aware though that this might not work in a shared database unless you're running A97.

Autonumbers are not intended to have any meaning so resetting an autonumber as a regular part of your app would indicate a design flaw. You should probably not be using an autonumber at all.
 

Users who are viewing this thread

Back
Top Bottom