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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VB to Compact 97 Access Database - without Access installed 1

Status
Not open for further replies.

zenenigma

Programmer
Apr 23, 2001
119
US
And without using DAO. I have a program writen in ADO (DAO was giving me some packaging problems). It uses a tag-along Access Database to store/access data for the front end. This database will have data imported into it and removed from it often. I'm looking for a method using ADO where I could compact the database from VB.

I know of these methods:

1) Command Line:
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "C:\Test\Test.mdb" /compact
(Won't work, most users won't have Access Installed)

2) Using another Database containing Compact Code:
Dim stAppName As String
stAppName = "MSAccess.exe ""C:\SpecialTax\SpecTaxCompact.mdb"" "
Call Shell(stAppName, 1)
Docmd.Quit
(Won't work, again, no Access on these machines)

3) DAO:
DBEngine.RepairDatabase Name.MDB
DBEngine.CompactDatabase Name.MDB, Another.MDB
(Trying to avoid DBO Because it gives me so many problems)
 
Look up JRO (Jet and Replication Objects). It has a CompactDatabase method, and runs under ADO

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top