Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old September 6th, 2004, 06:03 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


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.


Reply With Quote
  #2 (permalink)  
Old September 6th, 2004, 07:16 AM
Friend of Wrox
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post

A SQL Server connection is made to the database server, unlike Access where a connection is made to a single database, so this connection mode cannot be supported in SQL Server (OK you can specify the initial db in the conn string, but no locks are created at this stage). What you do instead will depend on why you feel you need to shut all other users out of the database entirely. I suggest you start by reading up on transaction support in SQL Server, particularly Isolation Levels.
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using DAO and ADO within ADODB.connection faridrd Access VBA 0 January 8th, 2008 09:43 PM
Exclusive ADO Connection bsa SQL Server 2000 2 August 24th, 2004 12:10 AM
ADO Connection String jmss66 Classic ASP Basics 3 February 3rd, 2004 11:10 AM
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

All times are GMT -4. The time now is 03:21 PM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.