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

How to take backup a Database from my VB Application

Status
Not open for further replies.

tskbalaji

Programmer
Jul 20, 2001
1
0
0
IN
Hai


How to take backup a Access Database from my Visual Basic application. I use Microsoft Visual basic 6.0 as a front end application and Microsoft Access 2000 as a database

I anyone could help me on this regard i would appreciate their work
thanks
kris
 
U have to use FileScriptingObject for bakuping your database
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "c:\mydatabase.mdb", "c:\backup\mydatabase.mdb", True

True is for overwrite ________

George
 
you could do it in your app terminate routine by having something like &quot;copyfile <yourdatabase> backuppath & &quot;Backup.mdb&quot;

ie
assuming your database is in the app directiry, and you want to save it to a backup directory on the &quot;c:&quot; drive

if len(trim(dir(&quot;C:\backup.mdb)) > 0 then kill &quot;C:\backup.mdb&quot; 'there are several ways of checking for an existing file - this is just one
copyfile app.path & data.mdb &quot;C:\backup&quot; & data.mdb
(I think it's copyfile, it may be filecopy)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top