|
-
January 17th, 2000, 02:02 AM
#1
Access Database Utilities
Hi all,
Here is a stupid post. If I wanted to compact my Access database (Access 97) via VB, how do I go about it? I've created a reference to the Access object, but am not sure how to call this command.
Thanks for your help.
____________________________________
The VB Bugs in my Life...
-
January 17th, 2000, 02:16 AM
#2
Re: Access Database Utilities
add a reference to DAO to your project and call the CompactDatabase method of the DBEngine object.
-
January 17th, 2000, 02:50 AM
#3
Re: Access Database Utilities
Hi again,
Forgot to mention that I am using ADO and not DAO, and I did try the CompactDatabase method via the DBEngine, but VB kept complaining about the application being open.
The question is, do I have to close my ADO connection first before doing this?
Thanks again
____________________________________
The VB Bugs in my Life...
-
January 17th, 2000, 02:53 AM
#4
Re: Access Database Utilities
ok, try this: MSDN article Q230501 describes how to compact a database via ADO:
you need to use "Microsoft Jet OLE DB Provider and Replication Objects (JRO). "
which comes with Jet 4...
check out the article it has all: source code and so on.
-
January 17th, 2000, 04:43 AM
#5
Re: Access Database Utilities
Thanks Lothar,
Found out why VB complained about my code. My ADO connection object was left open. So, I closed it and the code worked!!! Another bug I found was that I was compacting the database and used the same MDB file as the output.
Thanks for your help!
____________________________________
The VB Bugs in my Life...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|