Junction tables not matching related table after creating new backend (1 Viewer)

Jupie23

Registered User.
Local time
Today, 02:31
Joined
Nov 9, 2017
Messages
84
Thank you Jiri! How do I go about adding that? I've really only done code on forms, so I'm not sure where to even put it.
 

Solo712

Registered User.
Local time
Today, 03:31
Joined
Oct 19, 2012
Messages
828
Thank you Jiri! How do I go about adding that? I've really only done code on forms, so I'm not sure where to even put it.

I am just showing you a method of how to do an autobackup. You need to do a bunch of things if you want to adapt this to your environment.

1)create a simple table with one record. In the example it is called tblZ. It has three fields, zBUflag that prevents duplicate processing, zNextBU which is a string holding the time stamp of of next backup, and zBUinterval which determines the minutes between backups.

2) You need to have a form that stays on throughout the session. You can hide it. That form would have an OnTimer sub that runs say every three minutes. The timer sub would call the AutoBackup routine. The Autbackup checks the timestamp for the next backup and if it is past, it executes the backup (the backup itself has a timestamp in its filename). Then it resets the clock for the next backup.

3) You need to work out where you are going to store the backup files: the srcepath is your prod database, destpath is your storage area where you are placing your backups.

4) Since you are working with dependencies (inserts into junction tables) I recommend throwing the zBUflag (=True), to stop the backup from executing from the start of the record updates (Form's Before_Update) to the finish of the inserts. Then you can clear it again. That way you ensure against the slight possibility that someone was in the middle of saving the tables when autobackup hit in an inconsistent state. In most cases, the "Filecopy" would fail if the database was busy but you never know. Remember, this code executes inside several machines in parallel addressing the same database.

Good luck,

Jiri
 

Jupie23

Registered User.
Local time
Today, 02:31
Joined
Nov 9, 2017
Messages
84
Thank you for the info! That sounds a little above my skill level, but I will keep that on my list to play with when I get time. :)
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 03:31
Joined
Feb 19, 2002
Messages
43,223
Take a look at the tools offered at FMSINC.com They are reasonably priced and easy enough for you to set up. You cn use them to manage all your databases so they are quite a bargain when you down to it.
 

Users who are viewing this thread

Top Bottom