473,782 Members | 2,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_Ba ckup

Dim blnComplete As Boolean
Dim fso As Object

blnComplete = False

Set fso = New Scripting.FileS ystemObject

If Len(Dir(Databas e)) = 0 Then

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

Else

fso.CopyFile Database, BackupFileName, True
blnComplete = True

End If
Exit_Database_B ackup:
Set fso = Nothing
Database_Backup = blnComplete
Exit Function

Err_Database_Ba ckup:

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_B ackup

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.c om
http://www.accessmonster.com/Uwe/For...ccess/200604/1
Apr 5 '06 #1
5 1804

"rdemyan via AccessMonster.c om" <u6836@uwe> wrote in message
news:5e4cf302a0 656@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.c om
http://www.accessmonster.com/Uwe/For...ccess/200604/1
Apr 5 '06 #3

"rdemyan via AccessMonster.c om" <u6836@uwe> wrote in message
news:5e4cf302a0 656@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_Ba ckup

Dim blnComplete As Boolean
Dim fso As Object

blnComplete = False

Set fso = New Scripting.FileS ystemObject

If Len(Dir(Databas e)) = 0 Then

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

Else

fso.CopyFile Database, BackupFileName, True
blnComplete = True

End If
Exit_Database_B ackup:
Set fso = Nothing
Database_Backup = blnComplete
Exit Function

Err_Database_Ba ckup:

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_B ackup

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.c om" <u6836@uwe> wrote in message
news:5e4ec9be21 a67@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
1968
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 individual database
9
1587
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 who will. I have the IP, username, password. i have allready got all the files off the site with ftp, is the database in there? i dont really even know what i'm looking for, but i dont see any .mdb or .sql right off the bat.
9
1596
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
1590
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 have enough available space to accomadate a backup. I also can't shrink the files because part of that procedure would require a backup. Question: Can I use a redirected drive for the backup media? Is there a way to trick SQL into allowing...
1
1555
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 have an Acess database. I have to back up 3 tables from oracle into access. I have no idea how i would document this.
0
1254
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 this is to preserve my data in simple form. When one rents a remote MS-SQL db, one may find that getting a backup is more expensive than the renting. One could add other parts, say indexes, of the db to this procedure quite easily. I want only those...
5
1505
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 backing up their db's. Fools them..but its me that has to undo the boondogal. I would like to be able to put a buttom on the form which will send the a copy of the db to another drive, perhaps a USB stick. Any ideas? *** Sent via Developersdex...
0
969
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 trap this, and the data in the grid matches that in the arralist I then get "Index was out of range Must be non-negative and less than the size of the collection" stack trace reveals the problem is at System.Collections.Arraylist.get_Item(int32...
1
1659
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. Does this same problem exist with My SQL? In otherwords, could I take the native NTbackup.exe that comes with Server 2000 and back up an open MySQL database without stopping the engine first? Thanks.
1
1842
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 tape device. What is the command to effect this in linux? How is a tape device represented in the suse linux file system? If using the tape device involves mounting it, how is this done? The tape is an IBM VXAtape X23 Data Cartridge. Please help...
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9939
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8964
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7486
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5507
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4040
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2870
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.