Compacting database

  • Thread starter Thread starter Roy Goldhammer
  • Start date Start date
R

Roy Goldhammer

Hello there

I neet do reset auto number on access databases outside of access (on vb
full)

For this i know that i need to compact the database ahd it done when the
table is empty

Is there a way do compact access database with vb code (not access VB )?

any help would be useful
 
Assuming you're got a reference to DAO in your program, you can use the
DBEngine object's CompactDatabase method.

If for some reason you don't want to use DAO, you can use JRO.
http://support.microsoft.com/?id=230501

However, in my opinion, the desire to reset the value of an autonumber field
is usually indicative of a misuse of autonumbers. Autonumbers exist for a
single purpose: to provide a (practically guaranteed) unique value that can
be used for a primary key. Whether those values are 34564,34565, 34566 or 1,
2, 3, that purpose is met. Seldom, if ever, should your users even be aware
of the value of an autonumber field.
 
Back
Top