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

Program to Close Database, Run .bat, Re-open Database

Status
Not open for further replies.

infinitx

Technical User
Feb 26, 2004
212
US
Hi,
I have an access database (I know that this is a VB forum, but this concerns VB) that allows the user to back up their data.

I have a backup.bat file with the following code:

Code:
copy Database.mdb C:\Backup /y

This is what I have in mind:

I want the user to click a command button "Back Up Database" that is located on an access form. I want the database to close and a visual basic program to open. In the OnLoad event of the Program, I want the program to execute the file backup.bat which is located in the C:\My Documents directory. After the backup.bat is run, I want the Program to re-open the database that it closed in the beginning and to close itself.

Is this possible?

Thanks,
Alex
 
You don't really have to go through all that hassle. There are 2 possiblities:

1) You can use the backup facitlity that comes with Ms Access

2) Or else you can use VBA to make a backup without the need of .bat file!

Nick
 
Nick,

I figured it out how to do it using your 2nd way, which worked great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top