How to programmatically backup Access database using VB6?

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 the
few available 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 available under the
Tools menu, but don’t know enough to do this.

How should this be done programmatically? VB6 code-snippet greatly
appreciated!

Brian

Larry linson 2011-05-24 10:00:24

comp.databases.ms-access isn’t a particularly good place to get VB6 code
snippets, because most of the people here will tell you that there’s rarely
good reason to use a VB6 front end with an Access/Jet database, in “normal
business applications”. I’ve used classic VB since version 1, but never for
database applications, because it is so much easier to do in Access the
database work I wanted to do.

You might search the archives of this newsgroup at http://groups.google.com,
using Advanced Group Search, or you might seek a newsgroup that deals with
general VB questions, like comp.lang.basic.visual.misc if you didn’t get
response from your posting to comp.lang.basic.visual.database, or one of the
microsoft.public.vb.database newsgroups — there’s that base group, then
append .ado, .dao, .odbc, .rdo for specifics on which access method you’re
using.

Are you certain that Access will be installed on the target machine? It
often is not, and certainly need not be for VB to access a Jet (often, yes,
even by Microsoft, called an Access) database. Jet 3.51 came with the
original release of VB6, and was updated to Jet 4.0 with one of the Service
Packs to VB6.

This posting is provided “AS IS” with
no warranties, and confers no rights.

Phil stanton 2011-05-24 10:01:10

If it’s any help I could email you a small bit of a database which allows
you to back up either to Floppy (Zipped file) or to CD. If you would like
this, please e-mail me direct with the subject Access backup.