Hi,
Is it possible to back up the data.mdb file when the user exits the
executable (.mde)? How would I do that? And also perform a compact
and repair on exit.
The code and data are in separated into data.mdb and code.mde.
Thanks,
-paulw 6 1342
Keep one Form Open all the time -- visible or not, but not closeable via the
user interface, and put code to do what you want in the Close event of that
Form. Exit the appication using DoCmd.Quit from a different Form, and that
Form will close along with the others, so the code will execute.
Compact and Repair creates a new file... if disk space is not "at a premium"
you can archive the previous back-end, rename the new one, and re-link the
tables. I'd advise this, just in case something happened to go awry during
the Compact and Repair. If there's a problem with the new one, and that's
what you back up, and have deleted the old one, your chances of recovery are
hindered.
(That said, I have never experienced an error during Compact and Repair of a
working database in 15 years of using Access, but others have reported
corruption being _caused_ by C&R.)
Larry Linson
Microsoft Office Access MVP
"PW" <pa**********************@removehotmail.comwrote in message
news:74********************************@4ax.com...
Hi,
Is it possible to back up the data.mdb file when the user exits the
executable (.mde)? How would I do that? And also perform a compact
and repair on exit.
The code and data are in separated into data.mdb and code.mde.
Thanks,
-paulw
Hi Larry,
>Keep one Form Open all the time -- visible or not, but not closeable via the user interface, and put code to do what you want in the Close event of that Form. Exit the appication using DoCmd.Quit from a different Form, and that Form will close along with the others, so the code will execute.
What code would I use to back up the data.mdb?
Thanks!
-paulw
>Compact and Repair creates a new file... if disk space is not "at a premium" you can archive the previous back-end, rename the new one, and re-link the tables. I'd advise this, just in case something happened to go awry during the Compact and Repair. If there's a problem with the new one, and that's what you back up, and have deleted the old one, your chances of recovery are hindered.
(That said, I have never experienced an error during Compact and Repair of a working database in 15 years of using Access, but others have reported corruption being _caused_ by C&R.)
Larry Linson
Microsoft Office Access MVP
"PW" <pa**********************@removehotmail.comwrote in message news:74********************************@4ax.com.. .
>Hi,
Is it possible to back up the data.mdb file when the user exits the executable (.mde)? How would I do that? And also perform a compact and repair on exit.
The code and data are in separated into data.mdb and code.mde.
Thanks,
-paulw
FileCopy... but you'll have to unlink from the BackEnd before you can Copy
it or TransferDatabase, using which you'd have to, or CopyObject, or
TransferDatabase -- for details of which, see Help. It's been a long time
since I created a new Link to a backend database, so the details escape me,
but you use TransferDatabase, and there is good Help on that subject in
Access 2003 Help.
Larry Linson
Microsoft Office Access MVP
"PW" <pa**********************@removehotmail.comwrote in message
news:33********************************@4ax.com...
Hi Larry,
>>Keep one Form Open all the time -- visible or not, but not closeable via the user interface, and put code to do what you want in the Close event of that Form. Exit the appication using DoCmd.Quit from a different Form, and that Form will close along with the others, so the code will execute.
What code would I use to back up the data.mdb?
Thanks!
-paulw
>>Compact and Repair creates a new file... if disk space is not "at a premium" you can archive the previous back-end, rename the new one, and re-link the tables. I'd advise this, just in case something happened to go awry during the Compact and Repair. If there's a problem with the new one, and that's what you back up, and have deleted the old one, your chances of recovery are hindered.
(That said, I have never experienced an error during Compact and Repair of a working database in 15 years of using Access, but others have reported corruption being _caused_ by C&R.)
Larry Linson Microsoft Office Access MVP
"PW" <pa**********************@removehotmail.comwrote in message news:74********************************@4ax.com. ..
>>Hi,
Is it possible to back up the data.mdb file when the user exits the executable (.mde)? How would I do that? And also perform a compact and repair on exit.
The code and data are in separated into data.mdb and code.mde.
Thanks,
-paulw
On Thu, 03 Apr 2008 02:31:53 GMT, "Larry Linson"
<bo*****@localhost.notwrote:
>FileCopy... but you'll have to unlink from the BackEnd before you can Copy it or TransferDatabase, using which you'd have to, or CopyObject, or TransferDatabase -- for details of which, see Help. It's been a long time since I created a new Link to a backend database, so the details escape me, but you use TransferDatabase, and there is good Help on that subject in Access 2003 Help.
Larry Linson
Microsoft Office Access MVP
Hmmm. I have no idea how to unlink tables. Way back when I did write
a successful table linking module using Ken Getz's example in his
Access 97 dev guide which still works great for us.
Thanks Larry - your earlier tip seems pretty slick!
-paulw
> "PW" <pa**********************@removehotmail.comwrote in message news:33********************************@4ax.com.. .
>Hi Larry,
>>>Keep one Form Open all the time -- visible or not, but not closeable via the user interface, and put code to do what you want in the Close event of that Form. Exit the appication using DoCmd.Quit from a different Form, and that Form will close along with the others, so the code will execute. What code would I use to back up the data.mdb?
Thanks!
-paulw
>>>Compact and Repair creates a new file... if disk space is not "at a premium" you can archive the previous back-end, rename the new one, and re-link the tables. I'd advise this, just in case something happened to go awry during the Compact and Repair. If there's a problem with the new one, and that's what you back up, and have deleted the old one, your chances of recovery are hindered.
(That said, I have never experienced an error during Compact and Repair of a working database in 15 years of using Access, but others have reported corruption being _caused_ by C&R.)
Larry Linson Microsoft Office Access MVP
"PW" <pa**********************@removehotmail.comwrote in message news:74********************************@4ax.com ... Hi,
Is it possible to back up the data.mdb file when the user exits the executable (.mde)? How would I do that? And also perform a compact and repair on exit.
The code and data are in separated into data.mdb and code.mde.
Thanks,
-paulw
On Apr 2, 1:24*pm, PW <paulremove_williamson...@removehotmail.com>
wrote:
Hi,
Is it possible to back up the data.mdb file when the user exits the
executable (.mde)? *How would I do that? *And also perform a compact
and repair on exit.
The code and data are in separated into data.mdb and code.mde. *
Thanks,
-paulw
Public Sub BackupLinkedMDB()
Dim p$
With DBEngine(0)(0)
.TableDefs.Refresh
On Error Resume Next
Err = 0
p = _
.OpenRecordset( _
"SELECT DISTINCT CStr(DataBase) FROM mSysObjects WHERE Type = 6")(0)
End With
If Err = 0 Then _
BackupMDB p
End Sub
Public Sub BackupMDB(ByVal path$)
Dim a As Access.APPLICATION
Set a = New Access.APPLICATION
With a
On Error Resume Next
Err = 0
.OpenCurrentDatabase path, True
If Err = 0 Then _
.SaveAsText 6, "", Replace(path, ".", Format(Date, "YYYYDDMMHHNN."))
On Error GoTo 0
.CloseCurrentDatabase
End With
Set a = Nothing
End Sub
On Wed, 2 Apr 2008 22:54:30 -0700 (PDT), lyle
<ly************@gmail.comwrote:
>On Apr 2, 1:24*pm, PW <paulremove_williamson...@removehotmail.com> wrote:
>Hi,
Is it possible to back up the data.mdb file when the user exits the executable (.mde)? *How would I do that? *And also perform a compact and repair on exit.
The code and data are in separated into data.mdb and code.mde. *
Thanks,
-paulw
Public Sub BackupLinkedMDB() Dim p$
With DBEngine(0)(0) .TableDefs.Refresh On Error Resume Next Err = 0 p = _ .OpenRecordset( _ "SELECT DISTINCT CStr(DataBase) FROM mSysObjects WHERE Type = 6")(0) End With
If Err = 0 Then _ BackupMDB p End Sub
Public Sub BackupMDB(ByVal path$) Dim a As Access.APPLICATION Set a = New Access.APPLICATION
With a On Error Resume Next Err = 0 .OpenCurrentDatabase path, True If Err = 0 Then _ .SaveAsText 6, "", Replace(path, ".", Format(Date, "YYYYDDMMHHNN.")) On Error GoTo 0 .CloseCurrentDatabase End With
Set a = Nothing
End Sub
I'll give it a go Lyle. I've never written code like that before!
Very "Getz" like :-)
-paulw This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: apple |
last post by:
UDB v8 fp 6a on AIX 5.1.0.0
Below is a manual incremental recover from compressed backup datasets.
With external compress backup datasets, can it be coded to do an
automatic incremental recover?...
|
by: Joel Matthew |
last post by:
My boss was asking about incremental backups.
I was scratching my head, thinking that the transaction log and a backup
policy (script) for each record set (sorry about the archaic terminology)...
|
by: paul |
last post by:
Hi,
is there a way to configure automatic maintenance from command line ?
I want to access the option shown in control center like offline periods,
notify backups ...
thx
|
by: RoB |
last post by:
Hi all,
I'm coming from the Informix world and I have a customer using DB2
8.2.3 for Linux on Red Hat Enterprise ES.
The customer is performing filesystem backups of the containers etc
every...
|
by: Norm |
last post by:
Has anyone created an elegant way to automate database activation on
instance startup?
I come across a number of client sites that have DB2 installed because
it was sold embedded with another...
|
by: Salad |
last post by:
I am converting an application from A97 to A2003. I have 2 tables
created by another application as a Foxpro.dbf. The table has no index.
The connect string in A97 is
FoxPro...
|
by: =?Utf-8?B?TmFzc2VyIEJ1bmR1a2E=?= |
last post by:
Hello,
Configuring incremental NT Backup in windows XP Professional
From start menu go to RUN.
ntbackup.exe
Advance Mode
Backup Wizard (Advanced Mode)
Next and specify backup Items
Locate...
|
by: Kofa |
last post by:
Dear All,
I'd like to know whether it is possible to restore backups created on
a production machine, running DB2 9.1 on Windows, using DMS table
space containers, onto a developer's machine,...
|
by: Wayne |
last post by:
I'm trying to overcome the problem that some users including myself
have noticed with combo boxes in A2003 databases that are run in
A2007. When the combo is tabbed out of the backstyle changes to...
|
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: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |