i have a mdb located in server and n number of users are accessing and adding data to that mdb (source table). now i want to save the mdb tables in particular time interval frequently.
How to refresh/save database table in particular time interval frquently?
Collapse
X
-
The simplest way of achieving this is to write a DOS Batch file and run it at scheduled intervals. A batch file is simply a text file which DOS (underlying Windows) interprets.
Here's an example:
: In this file, any line that starts with a colon(:) is treated as comment.
:Such lines are not processed
: START OF DOS INSTRUCTIONS
rd /S /Q \\Server\F:Pers BU\********\3
ren \\Server\F:\Per sBU\********\2 3
ren \\Server\F:\Per sBU\********\1 2
md \\server\F:\Per sBU\********\1
xcopy D:\********Data \\Server\F:\Per sBU\********\1 /I /S /E /C /F /K /Y
xcopy C:\Docume~1\use r\LocalS~1\Appl ic~1\Identities \\Server\F:Pers BU\********\1 /I /S /E /C /F /K /Y
xcopy C:\Docume~1\use r\Applic~1\Micr osoft\addres~1 \\Server\F:\Per sBU\********\1 /I /S /E /C /F /K /Y
ATTRIB -H -R -S \\Server\F:\Per sBu\********\1
: END OF DOS INSTRUCTIONS
: Notes regarding customising
: For this batch file to work, you need to create 3 empty folders called 1, 2, 3 in the target location for your backup. The process works by deleting folder 3, the oldest, renaming 1 & 2 and then creating a new folder 1, into which your database is copied. The big advantage of this approach is that you don't need to close the database for the process to run.
: This batch file was written for specific locations. You need to edit Drive, Folder and File details to suit your own needs
: All changes must be exactly right. Typing errors are the biggest cause of problems when writing batch files.
: In the General Section,"****** **" should be changed to whatever other name is needed.
: The text in the first XCopy line should be changed from "D:\********Dat a"as necessary.
: The Batch file should be saved under a new name, "********.b at". -
To do this you simply set up a scheduled task in Windows, setting the repeat interval to whatever you wish. The scheduled task runs the batch file. The example I gave you is a version of one I use to run hourly. In this case there are more generations of folder, so that the risk of repeatedly backing up a corrupt file is reduced. As part of this strategy, separate daily and weelky tasks are also run.Comment
Comment