Jessee
asked on
VB6 Access Copy database
Hey,
Im adding a backup feature to my program, and am needing to copy my database to a specified location.
Problem is im unable to close the database so im needing to know how to re-create the database at the specified location.
Any ideas?
Thanks!
Im adding a backup feature to my program, and am needing to copy my database to a specified location.
Problem is im unable to close the database so im needing to know how to re-create the database at the specified location.
Any ideas?
Thanks!
Also remember that it is NEVER a good idea to copy an in-use Access file (or any other file for that matter). In most cases it won't matter, but if you happen to copy that file at the same time as someone attempts to write to the database, you'll end up with a corrupt file - and the only thing worse than no backup is a corrupt backup :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hey,
Yeah I have use FileCopy before but it didnt work out as if the Database was open which in most cases it is, I would get a permission denied error.
Will give these methods a go now.
Yeah I have use FileCopy before but it didnt work out as if the Database was open which in most cases it is, I would get a permission denied error.
Will give these methods a go now.
Easiest way to backup a access-database: Just copy the file to another location
(in vb:
dim strFileNameOriginal as string
dim strFileNameBackup as string
strFileNameOriginal = "c:\YourPath\YourDatabase.
strFileNameBackup = "c:\Backup\YourDatabase.md
FileCopy strFileNameOriginal, strFileNameBackup
Otherwise, you can take a look at:
With the help of this tool you can take backup of your MS-Access files and also restore the files.
With Auto backup facility and more. Try it.
http://www.a1vbcode.com/download.asp?ID=3252