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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get CopyDatabaseFile to work

Status
Not open for further replies.

hcisteve

Technical User
Jan 12, 2005
47
US
I am trying to use the CopyDatabaseFile method to backup my database. But every time I run it it tells me that the CopyDatabaseFile is not available at this time. I tried changing the options to No,No; Yes,NO; and No, Yes -- nothing worked.

DBFile = "FileName" + Str(Time) + ".mdf"
DoCmd.CopyDatabaseFile DBFile, Yes, Yes

Any ideas?
 
One more thing -- the helps advised me to add the mdf extension -- I have tried it both ways -- using the mdb and mdf extension.
 
Is your code in an ADP (project) ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
No, it isn't. So are you saying that it has to be for that method to work?

 
This is my understanding of the 1st line of the VBA help on the CopyDatabaseFile method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
It's not entirely clear to me what you wish to achieve, but there are lot of information on this site on backing up mdb's. Here is one thread181-767477. Quehay's suggestion (there are more than one, go to the bottom of the thread), also contains some errorlogging routines.

Roy-Vidar
 
You are correct. I wanted to back up my MDB. Thanks for the information.

hciSteve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top