Hi All,

I've database application that uses an ADO & Datagrid control. This application has Backup button that should copy the database to another location. When I click on the button it gives me an error Permission denied. When I changed the connection string, record source & refresh the ado then it works but the datagrid shows the new record source data.

Is there any other way to copy the database file?

Shrini

Hi,

If u want to make the backup of Access Database, I think u r using "fileCopy".

all the Connections Objects which have opened that database should be Closed . then only u can take back up.
Note : u cannot back up even if the access database is open in either Visdata or MS Office/Access.
just b4 backup close adoConnection.

Regards
Veena

Thanks for reply. I'm taking backup of database using seperate form. On Main form I've ADODC & Datagrid. In datagrid I'm displaying contents. If I close the connection on main form then datagrid gets cleared. It should not get cleared. So I tried to close in Backup form but still I get same error as "ldb" file is there.

Hi,

For any reason, if the Database is Open or there is an Active Connection, u cannot take the Back-Up.
In real time projects what we do is, Give Back-up Option in Seperate Form. There Close the Connection and take backup and then Restore the Connection.

Regards
Veena

Hi,

I've done the same, backup option in seperate form. But on main form I've displayed the Datagrid which shows the contents of database and it is displayed continuously. So if I close the connection then grid gets cleared. If I try to close on backup form it does get closed but ldb file (MS record locking information) is there, duw to which I can't copy mdb file.

This article has been dead for over six months. Start a new discussion instead.