Link to home
Start Free TrialLog in
Avatar of jaisu_krish
jaisu_krish

asked on

Backup for Access database using VB6

Hi,
        I want to take backup of Access database using VB.Is it possible?If yes, tell me how?

jaisu_krish
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Easiest way to backup a access-database: Just copy the file to another location
(in vb:    
dim strFileNameOriginal as string
dim strFileNameBackup as string
strFileNameOriginal = "c:\YourPath\YourDatabase.mdb"
strFileNameBackup = "c:\Backup\YourDatabase.mdb"

FileCopy strFileNameOriginal, strFileNameBackup

Otherwise, you can take a look at:
With the help of this tool you can take backup of your MS-Access files and also restore the files.
With Auto backup facility and more. Try it.
http://www.a1vbcode.com/download.asp?ID=3252
Avatar of jaisu_krish
jaisu_krish

ASKER

Hi,
        This one is not working..

jaisu_krish
What's not working ? Are you using vb or vba ?
Through VBA:
Private Sub Backup()

Dim Fs As Object
Dim a
Set Fs = CreateObject("Scripting.FileSystemObject")
a = Fs.CopyFile("c:\the path to yourDB.mdb", "c:\the path to backup file.mdb", True)
   
End Sub
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial