Therein lies the problem - dropping a multi-user databse is a sysy admin =
function, not really a user function.
As Daniel says - mark it and then deny users accessing it at the client =
code. You could implement a periodic check to see if its in use and =
notify when there are no connections and so allow the 'drop' at that =
time.
Sorry I can't really help you with the T-SQL - grab a copy of SQL Server =
Books Online and check out ALTER etc.
Chris.
[quoted text, click to view] "Bauji" <ashishkanoongo@rediffmail.com> wrote in message =
news:%23UQ%23RLBUDHA.3144@tk2msftngp13.phx.gbl...
But it did not work every time
"Chris Barber" <chris@blue-canoe.co.uk.NOSPAM> wrote in message =
news:%23qUSEP9TDHA.1552@TK2MSFTNGP10.phx.gbl...
You already have the appropriate error number:
"-2147217900 (80040e14) can not drop the database, it is currently =
in use....."
Chris.
[quoted text, click to view] "Bauji" <ashishkanoongo@rediffmail.com> wrote in message =
news:%23XVhmN8TDHA.2196@TK2MSFTNGP11.phx.gbl...
Dear=20
whatever you are saying is true, but how do I trap the error code, =
as I dont know what error number is returning the application?
Ash
[quoted text, click to view] "Martin Nicholson" <mgnicholson@hotmail.com> wrote in message =
news:%235W$gJ8TDHA.1724@TK2MSFTNGP10.phx.gbl...
From what I read in the other replies, what you should do is =
write error handling code into your app to produce a more user-friendly =
error message. =20
-regards, -marty nicholson
[quoted text, click to view] "Bauji" <ashishkanoongo@rediffmail.com> wrote in message =
news:e#8knI7TDHA.2188@TK2MSFTNGP10.phx.gbl...
I have created client server visual basic application, in =
which I am allowing to drop thedatabse to user. It works fine when a =
single user is working on it, but it gives problem at same time multiple =
user working on same database and one of them want to drop the databse. =
It gives following error
"-2147217900 (80040e14) can not drop the database, it is =
currently in use....."
How do I prevent this?
Is there any way to know someone is using the database? or I =