back up options

David b

Registered User.
Local time
Today, 12:50
Joined
Mar 2, 2003
Messages
102
I would like to include a back up routine in an app. Idealy click a button on the front end to copy the back end to a floppy.
Any thoughts on how to do this
TIA
David B
Hexham UK
 
I haven't come across a way of backing up an open db yet. This is one I have developed and told users to run on a regular basis
HTH
Dave
 

Attachments

This will copy the DB that is currently open. just change the file names including the full path. Also make sure you use the .mdb extension
 

Attachments

Couple of years ago saw a dos backup routine which sat on the desktop . It was soooo simple
The line said something like Copy C:\blah\blah, A:\

Trouble is I can not get it to work. Anyone remember back to dos?
David B
 
Are you using Notepad or WordPad to create the batch file? Are you naming the file ?.bat? Post the DOS commands you are trying to use and I'll have a look.

Autoeng
 
Have`nt passed go yet. Maybe I am too young to remember how to do the dos stuff <g>
David b
 
does that example not work for you?
 
Chewy
Thanks for your example. Need to sit down later tonight and look at all this stuff
David B
 
Does Chewy's backup work with open DB's

David,

I tested Chewy's backup code in one my DB's and it worked fine.

What is the result if the DB is still open by another user?

Is the DB in an inconsistant state?

Just wondering?

Thanks,

Gary
 
Does Chewy's backup work with open DB's

David,

I tested Chewy's backup code in one my DB's and it worked fine.

What is the result if the DB is still open by another user?

Is the DB in an inconsistant state?

Just wondering?

Thanks,

Gary
 
Have not got this going yet. Last time I tried I got file not found on this line - fso.CopyFile strFile1, strFile2, True
David b
 
David,

Here is the way I did it.

Option Compare Database
Option Explicit

'Makes a copy of the file
Function fCopyFile(strFile1 As String, strFile2 As String)

Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile strFile1, strFile2, True

End Function


Private Sub Backup_Click()
On Error GoTo Err_Routine
Dim OriginalFile As String
Dim BackupFile As String

'Changethis to the original and the copy, respectivaly

OriginalFile = "\\Fs Server\DBData\TestData.mdb"
BackupFile = "\\Fs Server\Backup\TestData_Backup.mdb"

fCopyFile OriginalFile, BackupFile

Exit_Routine:
Exit Sub

Err_Routine:
MsgBox Err.Description
Resume Exit_Routine

End Sub
 
Ricky,

Thanks for the reply.

I tested procedures using both the procedure you supplied and
the procedure that I had found and posted earlier in this post.

The procedure I posted earlier would backup the database
whether or not the database was open by another user.
This is not a viable option because the database could be
backed up while in an inconsistant state.

Thanks for posting your procedure. I have customized the
messages to apply to my database and my users.

David, if you are monitoring this, Ricky's procedure will insure
that the database that is backed up by the user last logging out
of the database and that the database is in a consistant state.
If a user logs out and the database is in use by another user,
the user logging out will be notified that the database is in use.

Once again Ricky, thanks.
 

Users who are viewing this thread

Back
Top Bottom