How to make sure there is not a connection to the database? RRS feed

  • Question

  • Hello everyone, due to the importance of this I really felt more comfortable asking everyone just to make sure that I do do it right. 

    Basically, I have a program that uses a Microsoft Access 2007 Database.  I added the ability to create a backup of the database, and also want to be able to restore from this backup.  My question I guess applies to both backing up and restoring really...  The database can't be in use when the backup is created.  I understand this, and it appears that it is only in use (Or has an open connection) when either reading or writing.  It isn't persistent.  Due to the potential for problems here though, I wanted to be able to close the connection as part of the backup and restore operations.  Does anyone know what the best way of doing this is?  I really don't want to create a problem down the line by creating poorly thought out code.  It really seems to me like this has the potential for some pretty serious problems if done improperly (Though I might be wrong).

    Thanks Again for all of the help.
    Wednesday, January 7, 2009 8:48 PM