Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backing up access database on server

Status
Not open for further replies.

themoff

Programmer
May 29, 2001
2
GB
Hi everyone,
Hope someone can help me with this. I've checked the FAQs and done a web search but turned up nothing.
I have several databases on my web site which I would like be automatically backed up daily. I'm thinking along the lines of getting my index.asp to check if it is 24 hours since the last backup, and if it is, call the backup routine.
From what I've read, I could use the
Code:
FileSystemObject
and simply copy the MDB files into a backup directory. Sounds too easy to me! I've read a thread on the VB forum regarding backing up Access databases and it was mentioned more than once that there would be the possibility of corruption of the database if someone was using it while it was being copied.

SO: Can I use the copy method described above to perform the backup?
If not, can anyone suggest another way?
Also, if I were to go for the simply copy method, would it work if I made it conditional upon whether anyone was using the database, and if so, how would I determine this? I wouldn't necessarily check for specifically someone accessing the database, but anyone in general using the website at that particular moment.

TIA for any help,

Robin
 
In my experience you would want to shut down the web site and make sure no one is using the database before doing backups. If you're using IIS you could just go to the IIS control panel and stop the web site to make sure no one is using it.

Or you could use the Microsoft scheduler (AT) to run a backup job at 3:00am or some other time when no one is on-line.

Another way is to migrate to history... run a program that selects records older than a certain date/time (if you have a "DateCreated" column) and write them to a history table. The danger here is that Access and history tables don't mix too well... you get about about a gig and suddenly your database can get corrupted.

In any event, I'd be careful about copying files while people are using the database.

Ben A.
 
Hi Ben,

Thanks for the suggestions. My site is hosted on a shared server, so accessing the IIS control panel or setting a scheduled program is not an option.

One suggestion I've had is to check for the .ldb file, and if it's not present then backup the database, while temporarily preventing any access to the DB during the backup. Since the DBs are small (~500k) the unavailability time is going to be minimal.
Do you think this sounds workable?

Cheers, Robin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top