Database Exclusive Connection

mahbub

Member
Joined
Oct 20, 2006
Messages
7
Programming Experience
Beginner
Hello,
I use VB2005 and SQL Server.
I want to connect to SQL server database exclusively. So that other user can't add, edit data in that database. How can I make that connection.

Pls Help me.

In Previous VB version I used Pessimistic lock or Connection.Mode=adShareExclusive
 
Hi, the link you gave also unanswered. I (administrator) need to do some update in database during which all other users have to wait until I finish.

In previous ADO version I used - connection.mode= adModeShareExclusive : which did my job.

Is there anything new in VB2005?

Thanks for reply.
 
.............I am doing that update from my VB2005 application. Other users using the same application have to wait untill I finish.
 
I dont really know, to be honest. I'm a little puzzled as to what update could be so important that other users must be locked out? Can you lock all the tables you plan to change ?
 
We have some software here that was written in VB.net and uses SQL.

The login table has a field called locked and is Boolean, and when anyone starts the program up, if the field is 1 it will not let them use the program. That allows any administrator of the program able to lock the system, for when we're going round installing new updates and can't have older versions accessing the system. When the admin logs in, he has an option of "lock users out", which simply sets that field to 1 or 0, (checked / unchecked).

Something like this may be a better option to you.

EDIT - however, in any case, how do you solve the issue of users already on the system if you've locked? As each program will be unique, there will be no way of telling you have logged on and locking the application on other machines. What happens if someone is in the middle of a transaction?
 
Back
Top