Backing up Access database in VB6

B

Brian

I've searched the net for an example of how to programmatically backup an
Access database using Visual Basic 6, but have found little of value as most
examples simply copy the database. I believe there's a better way of doing
this using an instance of the Access object which verifies the data -
something like the 'compress and repair' option in Access.

What's the best way of doing this, and can anyone provide a VB6 example? Any
help much appreciated.

Brian
 
T

Tony Toews

Brian said:
I've searched the net for an example of how to programmatically backup an
Access database using Visual Basic 6, but have found little of value as most
examples simply copy the database. I believe there's a better way of doing
this using an instance of the Access object which verifies the data -
something like the 'compress and repair' option in Access.

What's the best way of doing this, and can anyone provide a VB6 example?

The following is what I've done in VBA so I see no reason why you
couldn't do the same in VB.

When the user exits the FE attempt to rename the backend MDB
preferably with todays date in the name in yyyymmdd format. Ensure
you close all bound forms, including hidden forms, and reports before
doing this. If you get an error message, oops, its busy so don't
bother. If it is successful then compact it back.

See my Backup, do you trust the users or sysadmins? tips page for more
info.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top