Jump to content

Backup and restore MSAccess db from VB6

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
mrbar

mrbar

    Newbie

  • Members
  • PipPip
  • 10 posts
Can anyone teach me how to create backup and restore function?

The database is for the system itself, which means the database is currently open when the system is in use.

How to perform backup or restore? How to build such code?
:D MRBAR
visit http://www.mrbar.net

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
If you just want the data, go through each table doing a "SELECT * FROM table_name" and save the results somewhere. You can restore using INSERT statements.

For table structure, you'll need to do a little research on how to extract the table names/fields.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
mrbar

mrbar

    Newbie

  • Members
  • PipPip
  • 10 posts
What I mean was I want to backup my whole database into a new file, like duplicating the database.mdb to another file named databackup.mdb and later I can use the backup file if the database file is damaged or corrupted.
:D MRBAR
visit http://www.mrbar.net

#4
fyz

fyz

    Newbie

  • Members
  • Pip
  • 2 posts
Hi,

Copy the mdb file and put in another place is very useful. Besides, sometimes the backup also will damage. I would liek to use a tool called Advanced Access Repair to repair my corrupt Access MDB files . With the both methods, the mdb file is more likely to keep safe.

Alan