Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 23rd, 2004, 12:17 AM
bsa bsa is offline
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Exclusive ADO Connection

Hi,

I'm trying to open a SQL Server database exclusively using ADO. I'm setting the mode property of the connection to adModeShareExclusive as follows:

cn.Mode = adModeShareExclusive
cn.Open strCnn

Unfortunately, other users are still able to connect to the database. Does anyone have a solution to this ?

This property works well with MS Access but not with SQL Server.

Waiting for an early reply.


BSA
 
Old August 23rd, 2004, 10:24 AM
Authorized User
 
Join Date: Jul 2004
Location: cleveland, oh, USA.
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default


It's not the connection you need to change it's the database.

You'll have to first kill any jobs that are running on it,
then set in in exclusive single user mode, or resticted access.

I know how to do that through enterprise manage, but not via an ADO connection.

That should give you a start.

Whats the reason why you need exclusive access if I may ask?
David



 
Old August 24th, 2004, 12:10 AM
bsa bsa is offline
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
My application in VB needs to run certain utilities for which Exclusive Connection to the database is required in a multiuser environment.

So i need to open an exclusive ado connection through Visual Basic.


bsa





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using DAO and ADO within ADODB.connection faridrd Access VBA 0 January 8th, 2008 10:43 PM
Exclusive ADO Connection bsa Pro VB Databases 1 September 6th, 2004 07:16 AM
ADO Connection String jmss66 Classic ASP Basics 3 February 3rd, 2004 12:10 PM
Global ADO Connection object DaveParry123 ADO.NET 0 October 7th, 2003 03:44 AM
ADO connection using password values GLCGLC Wrox Book Feedback 1 August 25th, 2003 10:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.