Re: db in Single User mode yet can be accessed via odbc

From: Hari Prasad (hari_prasad_k_at_hotmail.com)
Date: 07/23/04


Date: Fri, 23 Jul 2004 12:14:49 +0530

Hi,

Can you login to Query Analyzer and execute SP_WHO and see whether there are
any connection made to that database (see the dbname column). Because I feel
that you are connecting to a different database , might be "MASTER" database
will be the default dabase when user connects in.

Thanks
Hari
MCDBA

"maxz" <anonymous@discussions.microsoft.com> wrote in message
news:27c301c4706f$43c9dcc0$a601280a@phx.gbl...
> Hi ,
>
> i hope i am doing it correct. This is how i do it.
>
> first i opened 2 ms access and connect to the db via
> odbc connection
> at the server end , i used the query analyzer and
> execute the alter database with rollback immediate
>
> i still find that the connections are still there , and
> even when i closed the access and re-open i could still
> open the links
>
> rdgs
> >-----Original Message-----
> >Hi,
> >
> >You cannot set the database to single user mode usng the
> below comamnd if
> >any user is connected to that partcular database.
> >
> >sp_dboption 'northwind','single user',true
> >
> >There are 2 options to make the database single user:-
> >
> >1. Kill all the connected users
> >2. Alter database with rollback options
> >
> >For SQL 2000 , the recommended option is ALTER database.
> >----------------------------------------------------------
> ---------
> >
> >To make the database immediately single user with all the
> user disconnected
> >
> >ALTER database <dbname> set single_user with rollback
> immediate
> >
> >To make the database single user after n seconds then (
> Here it is 120
> >seconds)
> >
> >ALTER database <dbname> set single_user with rollback
> after 120
> >
> >Thanks
> >Hari
> >MCDBA
> >
> >
> >
> >
> >
> >"maxz" <anonymous@discussions.microsoft.com> wrote in
> message
> >news:272501c47061$cad93e30$a601280a@phx.gbl...
> >> Hi ,
> >>
> >> How does the SINGLE USER actually works ,
> >> i have used the follwing commands :
> >> sp_dboption 'acb' , 'single user' 'true' and refresh
> >> which it shows the the db : abc is now single user.
> >>
> >> However , i can still access that db via odbc.
> >>
> >> Is this how a single user shld works ? Not as wat in
> >> the Books Online :
> >>
> >> SINGLE_USER allows one user at a time to connect to the
> >> database. All other user connections are broken. The
> >> timeframe for breaking the connection is controlled by
> the
> >> termination clause of the ALTER DATABASE statement. New
> >> connection attempts are refused. The database remains in
> >> SINGLE_USER mode even if the user who set the option
> logs
> >> off. At that point, a different user (but only one) can
> >> connect to the database
> >>
> >>
> >> thkz
> >>
> >
> >
> >.
> >



Relevant Pages

  • Re: ADO Connection Timeout
    ... so what happens when a connection failure forces one station to revert ... to a local database? ... Further, you *will* have contention issues, Jet does not support record ... to the central server, but you are willing to live with periods where it ...
    (microsoft.public.data.ado)
  • Strange SQL Server CE 2.0 Problem
    ... Server CE database that is stored on a flash card inside the device. ... I can't use the SQL CE Query Analyzer -- the device ... selectCommand = new SqlCeCommand(sql, _connection, transaction); ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: ADO Connection Timeout
    ... When the first test is run, the results are stored in the central database. ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)
  • Re: SQL Server 2000 (Application) Role accessed through ADO.NET
    ... >> The database role claims to answer my ... >> through the Connection Object of ADO.NET ... Then I execute the SQL statement passed to the method ...
    (microsoft.public.sqlserver.security)
  • Re: ADO Connection Timeout
    ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)