473,326 Members | 2,108 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Backing up the front-end from code within the front-end

I have code in my front end that opens a form for backing up the front end.
I'll give a brief description of what the form does:

1) When the backup form opens, it closes all open forms except for three
hidden forms and the backup form itself.
2) It automatically creates a backup name for the front end and displays the
folder where it will be backed up.
3) The user clicks the backup button and the following code executes:
************************************************** ************************************************** *********
Public Function Database_Backup(Database As String, BackupFileName As String)
As Boolean

On Error GoTo Err_Database_Backup

Dim blnComplete As Boolean
Dim fso As Object

blnComplete = False

Set fso = New Scripting.FileSystemObject

If Len(Dir(Database)) = 0 Then

MsgBox "The requested database file does not exist.", vbOKOnly +
vbInformation

Else

fso.CopyFile Database, BackupFileName, True
blnComplete = True

End If
Exit_Database_Backup:
Set fso = Nothing
Database_Backup = blnComplete
Exit Function

Err_Database_Backup:

If Err.Number = 70 Then
MsgBox "You cannot backup " & Database & " because it is opened
exclusively by another user." & vbCrLf & _
"If you're trying to write the file to a CD, you'll have to do that
from Explorer.", vbOKOnly + vbExclamation Else
MsgBox Err.Number & " - " & Err.DESCRIPTION, vbOKOnly + vbExclamation

End If

Resume Exit_Database_Backup

End Function
************************************************** ************************************************** *********

Now after six months, I'm having second thoughts as to whether this method
will always work correctly. As far as I know, I haven't had any problems and
I probably average two to three backups per day. It's just that my app is
now so large (170+ forms, 120+ tables), there is no way I can test all of the
functionality of a backup copy.

What precipitated the second thoughts is that I have recently added two
additional hidden forms for sending system messages and for forcing a logoff.

My concern is that I now have four forms open when the front end is copied.
That would be the hidden startup form, two other hidden forms and the backup
form itself, of course. I could, close the two new hidden forms, and then
reopen them. I guess, now that I think about it, I could even close the
startup form just before the filecopy and then load it again after the
filecopy occurs. This would go through the whole startup process again, but
I don't think this would be a major problem.

Any comments on my method and what I'm doing. I just want to make sure that
what I'm doing isn't going to cause me corruption problems or any other type
of problem.

Thanks.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200604/1
Apr 5 '06 #1
5 1775

"rdemyan via AccessMonster.com" <u6836@uwe> wrote in message
news:5e4cf302a0656@uwe...
I have code in my front end that opens a form for backing up the front end.
I'll give a brief description of what the form does:

1) When the backup form opens, it closes all open forms except for three
hidden forms and the backup form itself.
2) It automatically creates a backup name for the front end and displays
the
folder where it will be backed up.
3) The user clicks the backup button and the following code executes:


My question is "Why do you want to back up the front end?" The front end
contains the queries, forms, reports, macros and modules. Nothing here
should change unless you're making modifications to the design of these
objects. Have you set up the database so every body has their own copy of
the front end on their PC?

If you're making changes to the front end, you should have a copy of the
unchanged front end so other people can use the database while you're making
the changes. That copy of the unchanged front end should be on your backup
tapes (or other backup media) to be used for recovery purposes. When I'm
making changes to the front end and there's a lot of changes to make, I
regularly go to explorer and do a copy and paste of the front end giving a
file name of "Copy (2) of DBName.mdb". They all have time stamps to find out
when you made that copy.
Jeff
Apr 5 '06 #2
I want to backup the front-end prior to compacting the front end.

Do you have any comments on my method?

Thanks.

Jeff Smith wrote:
I have code in my front end that opens a form for backing up the front end.
I'll give a brief description of what the form does:

[quoted text clipped - 5 lines]
folder where it will be backed up.
3) The user clicks the backup button and the following code executes:


My question is "Why do you want to back up the front end?" The front end
contains the queries, forms, reports, macros and modules. Nothing here
should change unless you're making modifications to the design of these
objects. Have you set up the database so every body has their own copy of
the front end on their PC?

If you're making changes to the front end, you should have a copy of the
unchanged front end so other people can use the database while you're making
the changes. That copy of the unchanged front end should be on your backup
tapes (or other backup media) to be used for recovery purposes. When I'm
making changes to the front end and there's a lot of changes to make, I
regularly go to explorer and do a copy and paste of the front end giving a
file name of "Copy (2) of DBName.mdb". They all have time stamps to find out
when you made that copy.

Jeff


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200604/1
Apr 5 '06 #3

"rdemyan via AccessMonster.com" <u6836@uwe> wrote in message
news:5e4cf302a0656@uwe...
I have code in my front end that opens a form for backing up the front end.
I'll give a brief description of what the form does:

1) When the backup form opens, it closes all open forms except for three
hidden forms and the backup form itself.
2) It automatically creates a backup name for the front end and displays
the
folder where it will be backed up.
3) The user clicks the backup button and the following code executes:
************************************************** ************************************************** *********
Public Function Database_Backup(Database As String, BackupFileName As
String)
As Boolean

On Error GoTo Err_Database_Backup

Dim blnComplete As Boolean
Dim fso As Object

blnComplete = False

Set fso = New Scripting.FileSystemObject

If Len(Dir(Database)) = 0 Then

MsgBox "The requested database file does not exist.", vbOKOnly +
vbInformation

Else

fso.CopyFile Database, BackupFileName, True
blnComplete = True

End If
Exit_Database_Backup:
Set fso = Nothing
Database_Backup = blnComplete
Exit Function

Err_Database_Backup:

If Err.Number = 70 Then
MsgBox "You cannot backup " & Database & " because it is opened
exclusively by another user." & vbCrLf & _
"If you're trying to write the file to a CD, you'll have to do that
from Explorer.", vbOKOnly + vbExclamation Else
MsgBox Err.Number & " - " & Err.DESCRIPTION, vbOKOnly +
vbExclamation

End If

Resume Exit_Database_Backup

End Function
************************************************** ************************************************** *********

Now after six months, I'm having second thoughts as to whether this method
will always work correctly. As far as I know, I haven't had any problems
and
I probably average two to three backups per day. It's just that my app is
now so large (170+ forms, 120+ tables), there is no way I can test all of
the
functionality of a backup copy.

What precipitated the second thoughts is that I have recently added two
additional hidden forms for sending system messages and for forcing a
logoff.

My concern is that I now have four forms open when the front end is
copied.
That would be the hidden startup form, two other hidden forms and the
backup
form itself, of course. I could, close the two new hidden forms, and then
reopen them. I guess, now that I think about it, I could even close the
startup form just before the filecopy and then load it again after the
filecopy occurs. This would go through the whole startup process again,
but
I don't think this would be a major problem.

Any comments on my method and what I'm doing. I just want to make sure
that
what I'm doing isn't going to cause me corruption problems or any other
type
of problem.

Thanks.



As you have found out, you can take a backup copy while the database is
open - and it will probably be OK. As I suspect you already know, this is
not recommended and if you want to be on the safe side, you should close the
file first. If you close the application first you need some way to restart
it and that will need code in another place - but that could simply be
another mdb file or a vbs file.
The first file could create a prepared shell line, passing in data with the
/cmd option, open the second file and close the first. The second
application now knows which file to backup and re-open.
Apr 5 '06 #4
"rdemyan via AccessMonster.com" <u6836@uwe> wrote in message
news:5e4ec9be21a67@uwe...
I want to backup the front-end prior to compacting the front end.

Do you have any comments on my method?


In a split environment where each user has their own local copy (the way it
should be) one would normally also have some sort of automatic or semi-automatic
way of distributing new versions. This makes the front end file basically
"disposable". There should be little reason to compact it or back it up because
it can easily be replaced with a new copy.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Apr 5 '06 #5
rdemyan wrote
"Now after six months, I'm having second thoughts as to whether this
method
will always work correctly. As far as I know, I haven't had any
problems and
I probably average two to three backups per day. It's just that my app
is
now so large (170+ forms, 120+ tables), there is no way I can test all
of the
functionality of a backup copy."

Haven't you been testing your app during the development? If you have 170
forms then you must have tested them to see if they were working correctly
when you developed them, and also when you made changes to them, and also
when you used other objects to open up those forms. You must have done some
more testing when you finished developing a section of the app.

What do you mean that there is no way that you can test all of the
functionality of a backup copy? A copy is a copy. It should contain all the
objects and functions as the original if there's been no changes to either
copy.

Making a copy of an app that size before any design changes is a good idea
but do you have to incorporate a backup routine into the app just to make a
backup of itself. Are you making changes to the forms or are you
continuously adding new forms? If you're making changes to the forms/reports
there's two ways you can do this: Make a copy of the form/report inside the
app and then make the changes or make the changes in the backup copy and
import that form/report into the main app when finished. The last way means
that you don't do any development in the main front end and it won't get
corrupted, all work is done on a copy.
Jeff
Apr 5 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: mark | last post by:
Hi I'm hoping that some could point me in the right direction for "best practice" in: 1) securely backing up a complete sql7 and 2000 server containing many databases. 2) backing up an...
9
by: J. Frank Parnell | last post by:
hello, i dont know asp at all, but i have been asked to backup a database that is used on a site which uses .aspx. i dont need to do anything with it, just copy it and send it along to someone...
9
by: Jerry Porter | last post by:
Is there a way to back up the design changes in a SQL Server database without backing up all the data? It's just test data at this point.
3
by: war_wheelan | last post by:
I am having a problem backing up my database and TLog files due to a lack of local diskspace. The db file is about 30GB and the TLog is about 20GB each on a different hard disk. Each disk doesn't...
1
by: Pavs | last post by:
This may not be the place to ask however i am looking for resources on how i may document data I am backing up from an oracle database to MS Access. Basically I have my oracle database and i...
0
by: Lyle Fairfield | last post by:
I have posted previously a procedure for backing up a remote MS-SQL db as text. This is a revised version in Javascript/JScript. This backups data and procedures as XML. My purpose in creating...
5
by: Stewart Graefner | last post by:
I would like to know if an Access db can be backed up with the push of a command button. I work with extreamly lazy operators who despite crashing their db's still refuse to see the value in...
0
by: guy | last post by:
I have and arraylist bound to a datagrid which on the whole works fine, however if i select a row as soon as I leave the grid i get "Error when commiting row to backing datastore" I cant seem to...
1
by: rob.w | last post by:
I am new to MySQL. I have an application using MySQL running on Windows Server 2000. If I were using Microsoft SQL Server 2000, I would need special software to back up an open SQL Server database....
1
by: Akaketwa | last post by:
Guys may yu assist me am stuck. Am using v8.1 db2 database on Suse Linux running on an IBM pSeries server. I am aware of the backup utility in db2. I would like to back up the my db2 database to a...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.