all groups > sql server programming > july 2003 >
You're in the

sql server programming

group:

Heeeeeelp: Prevent to Drop the Databse


Re: Heeeeeelp: Prevent to Drop the Databse Martin Nicholson
7/21/2003 3:56:30 PM
sql server programming:
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]

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 can lock =
Re: Heeeeeelp: Prevent to Drop the Databse Chris Barber
7/21/2003 7:08:10 PM
You should keep your own running tab of users currently accessing the DB =
and only allow them to drop it when it can be converted to single-user =
mode?

What database? Sounds like SQL Server?

ON a side note ......why would you ever want to 'drop' the database?

Chris.
[quoted text, click to view]

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 can lock =
Re: Heeeeeelp: Prevent to Drop the Databse Chris Barber
7/21/2003 11:02:23 PM
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]
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]
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]

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 can =
Heeeeeelp: Prevent to Drop the Databse Bauji
7/21/2003 11:31:43 PM

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 can lock =
Re: Heeeeeelp: Prevent to Drop the Databse Bauji
7/22/2003 1:35:10 AM
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]
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]

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 can =
Re: Heeeeeelp: Prevent to Drop the Databse Chris Barber
7/22/2003 10:19:10 AM
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]
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]
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]
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]

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 =
Re: Heeeeeelp: Prevent to Drop the Databse Bauji
7/22/2003 11:03:40 AM
But it did not work every time
[quoted text, click to view]
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]
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]
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]

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 can =
AddThis Social Bookmark Button