Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compact Database 1

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
US
Guys,

Does anyone know of a command that can be run from an ASP program to compact an Access database?? Mighty :)
 
May I know why should I compact my database ?? Rushi Shroff Rushi@emqube.com
"Life is beautiful."
 
Kevin,

That link you supplied me with was perfect.
Thanks.

Rushi,

The reason that I want to compact my database is that I delete certain records from it depending on the customers choices and make it available to download. However, the whole reason for deleting the records is to reduce it's size. However, unless you compact the database the size remains the same even though it contains less records. Hope that answers your question. Mighty :)
 
Even though when you can no longer see a table and its records that you have deleted from an Access Database,the file itself still takes up the same amount of space. It is similar to the way Windows handles the deletion of files and the way that a disk can become fragmented. Compacting the database will reduce the space used and improve the performance inwhich records can be retrieved.
 
Kevin,

Using the link you gave me, the JRO option did not work on my PC (Win2K) but the DAO option worked perfectly. So I modified my program and copied it onto my live webserver (Win NT) only to discover that it doesn't work there. i am presuming that the webserver does not have DAO 3.5. Do you have any idea how I can check this or where I can download DAO 3.5?? Mighty :)
 
Kevin,

I'm back to this again. I have got it creating the DAO Engine object now but I am getting the following error when I try to run the compact command:

DAO.DbEngine error '800a0c0d'

Undefined function 'CStr' in expression.

Does that mead anything to you?? Mighty :)
 
Hi Mighty

I check with MSDN to see if I can find a reference on the error. Sounds right off like it is calling on but does not understand the convert to string function (CStr).
Out of curiosity which DAO version are you referencing .. 3.5 or 3.6 ?
 
Kevin,

I am still referencing DAO 3.5. As I said, it is now creating the engine object but giving the above error. Mighty :)
 
Hi Mighty

Sorry but I have not found anything specific to the error number. You might want to repost the question to see if anyone else has an idea. The only other thing I could suggest is trying to upgrade it to 3.6 and update the MDAC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top