By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,988 Members | 1,049 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,988 IT Pros & Developers. It's quick & easy.

backup and recovery

P: 13
hello Veena,

i am using MS-Access as Backend can you explain how i can apply backup and recovery in my project?

Thanking You
Rathiga
Sep 5 '07 #1
Share this Question
Share on Google+
2 Replies


QVeen72
Expert 100+
P: 1,445
Hi,

I had already replied this in ur previous thread:

Hi,

If MS-Access, then it's quite Simple, Copy the .mdb Access File using "FileCopy":
Check this :

For Back Up

Code: ( vb )
If Dir("C:\BackUp\MyDB.mdb", vbDirectory) <> "" Then
'If Already Exisits then Delete It
Kill "C:\BackUp\MyDB.mdb"
End If
FileCopy App.Path & "\MyDB.mdb", "C:\BackUp\MyDB.mdb"


For Restore :


Code: ( vb )
If Dir("C:\BackUp\MyDB.mdb", vbDirectory) <> "" Then
If Dir(App.Path & "\MyDB.mdb", vbDirectory) <> "" Then
'Remove Current Working DB
Kill App.Path & "\MyDB.mdb"
End If
FileCopy "C:\BackUp\MyDB.mdb", App.Path & "\MyDB.mdb"
Else
Msgbox "No Back Up Database Found"
Exit Sub
End If


Change this App.Path & "\MyDB.mdb" to ur Variable/Actual Database Name/Path Name

Note Before doing any Back-Up / Restore Operations u have to "Close All the Connections of the Database" in the Code. otherwise u cannot do the file copy...


REgards
Veena
Sep 5 '07 #2

Ali Rizwan
100+
P: 927
Hi,

I had already replied this in ur previous thread:

Hi,

If MS-Access, then it's quite Simple, Copy the .mdb Access File using "FileCopy":
Check this :

For Back Up

Code: ( vb )
If Dir("C:\BackUp\MyDB.mdb", vbDirectory) <> "" Then
'If Already Exisits then Delete It
Kill "C:\BackUp\MyDB.mdb"
End If
FileCopy App.Path & "\MyDB.mdb", "C:\BackUp\MyDB.mdb"


For Restore :


Code: ( vb )
If Dir("C:\BackUp\MyDB.mdb", vbDirectory) <> "" Then
If Dir(App.Path & "\MyDB.mdb", vbDirectory) <> "" Then
'Remove Current Working DB
Kill App.Path & "\MyDB.mdb"
End If
FileCopy "C:\BackUp\MyDB.mdb", App.Path & "\MyDB.mdb"
Else
Msgbox "No Back Up Database Found"
Exit Sub
End If


Change this App.Path & "\MyDB.mdb" to ur Variable/Actual Database Name/Path Name

Note Before doing any Back-Up / Restore Operations u have to "Close All the Connections of the Database" in the Code. otherwise u cannot do the file copy...


REgards
Veena
If we use fso.copyfile then file is copied whether it is open or close.
and i m also using fso.copyfile
Sep 5 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.