Hi, I'm writing an automatic database backup system for my company.
When I want to restore my database to the SQL Server I need to ensure that I have exlusive access to the database in question.
I have a way of retrieving the processes accessing the database (from the sysprocesses table in master). Does anyone have a better way of doing this? Ideally, I'd like to be able to open the database in "exclusive" mode (like you are able to do with a Jet database) but I'm not sure that this is possible.
The structure of the program is;
if CanOpenSQLExclusively then
Restore database
else
display a message to the user
endif
....
Thanks,
Lachlan