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
you could do it in your app terminate routine by having something like "copyfile <yourdatabase> backuppath & "Backup.mdb"
ie
assuming your database is in the app directiry, and you want to save it to a backup directory on the "c:" drive
if len(trim(dir("C:\backup.mdb)) > 0 then kill "C:\backup.mdb" 'there are several ways of checking for an existing file - this is just one
copyfile app.path & data.mdb "C:\backup" & data.mdb
(I think it's copyfile, it may be filecopy)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.