npersaud Posted November 17, 2005 Share Posted November 17, 2005 I have an access database that I want to set up so that it will automatically make a backup copy of itself every few days (the filename would remain the same except with the date appended to it). I haven't the foggiest idea how to make Access perform this, however. My first two thoughts were to write a VBA script or write a C++ script and have the Access program run it. I still don't know how to make it happen, though!FYI, this database isn't on a server or anything, really. Link to comment Share on other sites More sharing options...
hazard_abio Posted November 17, 2005 Share Posted November 17, 2005 I have an access database that I want to set up so that it will automatically make a backup copy of itself every few days (the filename would remain the same except with the date appended to it). I haven't the foggiest idea how to make Access perform this, however. My first two thoughts were to write a VBA script or write a C++ script and have the Access program run it. I still don't know how to make it happen, though!FYI, this database isn't on a server or anything, really.Scheduled task plus a Batch File should do it. Here is a sample of a batch file that I use every now and then. @ECHO OFF:: YearSET D1=%date:~-4,10%:: DaySET D2=%date:~7,-5%:: MonthSET D3=%date:~4,-8%SET PATHTODB=c:\DBSET DBFILE=MyDatabaseSET DBEXT=.mdbSET PATHTOBACKUP=c:\backup:: Please note if the path to the backup exists within a network path this will not work:: you will need to map the network drive first.COPY "%PATHTODB%\%DBFILE%%DBEXT%" "%PATHTOBACKUP%\%DBFILE%--%D3%-%D2%-%D1%%DBEXT%" /Y Link to comment Share on other sites More sharing options...
secowu Posted December 16, 2005 Share Posted December 16, 2005 @ECHO OFF:: YearSET D1=%date:~-4,10%:: DaySET D2=%date:~7,-5%:: MonthSET D3=%date:~4,-8%SET PATHTODB=c:\DBSET DBFILE=MyDatabaseSET DBEXT=.mdbSET PATHTOBACKUP=c:\backup:: Please note if the path to the backup exists within a network path this will not work:: you will need to map the network drive first.COPY "%PATHTODB%\%DBFILE%%DBEXT%" "%PATHTOBACKUP%\%DBFILE%--%D3%-%D2%-%D1%%DBEXT%" /Y good,it works fine Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now