dbTalk Databases Forums  

Sample code to backup changed records while backend MDB open viaappend queries to another DB

comp.databases.ms-access comp.databases.ms-access


Discuss Sample code to backup changed records while backend MDB open viaappend queries to another DB in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
BobAlston
 
Posts: n/a

Default Re: Sample code to backup changed records while backend MDB openvia append queries to another DB - 03-11-2011 , 06:21 PM






On 3/11/2011 5:35 PM, David-W-Fenton wrote:
Quote:
I now plan to alter the process to create
the backup as a temporary file in the %temp% folder on the local
computer, do any compact in place in the %temp% folder, and only
then copy it to the final destination for the backup.

I totally agree with the above and that is my plan to use in my "every
two hour backup strategy". It will make the elapse time of the back
much shorter than creating the backup across the network.

bob

Reply With Quote
  #12  
Old   
Salad
 
Posts: n/a

Default Re: Sample code to backup changed records while backend MDB openvia append queries to another DB - 03-11-2011 , 10:20 PM






BobAlston wrote:

Quote:
On 3/11/2011 5:35 PM, David-W-Fenton wrote:

I now plan to alter the process to create
the backup as a temporary file in the %temp% folder on the local
computer, do any compact in place in the %temp% folder, and only
then copy it to the final destination for the backup.



I totally agree with the above and that is my plan to use in my "every
two hour backup strategy". It will make the elapse time of the back
much shorter than creating the backup across the network.

bob
Could you create a batchfile, something like
MDBCOPY.BAT
COPY C:\MYMDB.MDB %1
Then call the batchfile and pass the name MYMDB is to be copied to?
Var = "ANEWCOPY.MDB"
CopyCommand = "COMMAND.COM /C C:\MDBCOPY.BAT " & var
x=Shell(MyCommand, 1)

Reply With Quote
  #13  
Old   
Clif McIrvin
 
Posts: n/a

Default Re: Sample code to backup changed records while backend MDB open via append queries to another DB - 03-12-2011 , 08:25 AM



"Salad" <salad (AT) oilandvinegar (DOT) com> wrote

Quote:
BobAlston wrote:

On 3/11/2011 5:35 PM, David-W-Fenton wrote:

I now plan to alter the process to create
the backup as a temporary file in the %temp% folder on the local
computer, do any compact in place in the %temp% folder, and only
then copy it to the final destination for the backup.



I totally agree with the above and that is my plan to use in my
"every two hour backup strategy". It will make the elapse time of
the back much shorter than creating the backup across the network.

bob

Could you create a batchfile, something like
MDBCOPY.BAT
COPY C:\MYMDB.MDB %1
Then call the batchfile and pass the name MYMDB is to be copied to?
Var = "ANEWCOPY.MDB"
CopyCommand = "COMMAND.COM /C C:\MDBCOPY.BAT " & var
x=Shell(MyCommand, 1)

Typo alert: CopyCommand and MyCommand in the above code look like they
are supposed to be the same variable.

I've never used Shell ... but why use a .bat file at all?

MyCommand = "COMMAND.COM /C COPY C:\MYMDB.MDB " & var

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)

Reply With Quote
  #14  
Old   
Salad
 
Posts: n/a

Default Re: Sample code to backup changed records while backend MDB openvia append queries to another DB - 03-12-2011 , 09:56 AM



Clif McIrvin wrote:
Quote:
"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message
news:kaadnfi3uKc4aefQnZ2dnUVZ_oednZ2d (AT) earthlink (DOT) com...

BobAlston wrote:


On 3/11/2011 5:35 PM, David-W-Fenton wrote:


I now plan to alter the process to create
the backup as a temporary file in the %temp% folder on the local
computer, do any compact in place in the %temp% folder, and only
then copy it to the final destination for the backup.



I totally agree with the above and that is my plan to use in my
"every two hour backup strategy". It will make the elapse time of
the back much shorter than creating the backup across the network.

bob

Could you create a batchfile, something like
MDBCOPY.BAT
COPY C:\MYMDB.MDB %1
Then call the batchfile and pass the name MYMDB is to be copied to?
Var = "ANEWCOPY.MDB"
CopyCommand = "COMMAND.COM /C C:\MDBCOPY.BAT " & var
x=Shell(MyCommand, 1)



Typo alert: CopyCommand and MyCommand in the above code look like they
are supposed to be the same variable.

I've never used Shell ... but why use a .bat file at all?

MyCommand = "COMMAND.COM /C COPY C:\MYMDB.MDB " & var

Not sure why I was thinking of a bat file. Kinda dated. I suppose one
could use FileCopy as well.

Even if somebody was in an app, I'd sometimes go to a folder via
Explorer and do a Ctrl+C/V to get a copy. I never had a problem opening
up the copy. Doesn't mean there couldn't be a problem. Just that I
never had one. I don't know if the OP was looking at an incremental
change of records or if a simple copy of the entire file was to be made.

Reply With Quote
  #15  
Old   
Clif McIrvin
 
Posts: n/a

Default Re: Sample code to backup changed records while backend MDB open via append queries to another DB - 03-12-2011 , 10:18 AM



"Salad" <salad (AT) oilandvinegar (DOT) com> wrote

Quote:
Clif McIrvin wrote:
"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message
news:kaadnfi3uKc4aefQnZ2dnUVZ_oednZ2d (AT) earthlink (DOT) com...

[ ]
Even if somebody was in an app, I'd sometimes go to a folder via
Explorer and do a Ctrl+C/V to get a copy. I never had a problem
opening up the copy. Doesn't mean there couldn't be a problem. Just
that I never had one. I don't know if the OP was looking at an
incremental change of records or if a simple copy of the entire file
was to be made.

I have the strong impression that sooner or later that hot copy would
catch JET/ACE in the act of updating and the copy would have (at least)
one record that was only partially updated. For the purposes of FE
testing that would likely never be an issue .... for the purposes of
data integrity that's a whole different matter.

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)

Reply With Quote
  #16  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Sample code to backup changed records while backend MDB open via append queries to another DB - 03-13-2011 , 02:17 PM



Salad <salad (AT) oilandvinegar (DOT) com> wrote in
news:kaadnfi3uKc4aefQnZ2dnUVZ_oednZ2d (AT) earthlink (DOT) com:

Quote:
Could you create a batchfile, something like
MDBCOPY.BAT
COPY C:\MYMDB.MDB %1
Then call the batchfile and pass the name MYMDB is to be copied
to? Var = "ANEWCOPY.MDB"
CopyCommand = "COMMAND.COM /C C:\MDBCOPY.BAT " & var
x=Shell(MyCommand, 1)
The whole point of this threat was, I thought, to get a guaranteed
good copy. Copying through the file system is not going to do that.

On the other hand, I haven't yet checked my backup method for
multi-user issues, either. I would expect that if it can't backup,
it will at least throw a trappable error, and then you can retry
later.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.