Re: Set Restricted_User

From: Sue Hoegemeier (Sue_H_at_nomail.please)
Date: 11/11/04

  • Next message: Yaron: "Re: Change password to sa user from remote client"
    Date: Wed, 10 Nov 2004 16:43:47 -0700
    
    

    I haven't tried playing with it using another app but I
    would guess that if you execute the command while connected
    to the database, the connection may drop as the database
    properties you are connected to changes. I'm not sure about
    the other users but for the app that executes the command to
    restricted_user mode, try setting master as the database in
    the connection string. Then execute the command and then try
    changing to the other databases and do whatever (or just
    execute everything with fully qualified names and execute
    from master). I would guess that it should not affect the
    connection that from the app that executes the statement.
    Just a guess though.

    -Sue
    .
    On Wed, 10 Nov 2004 15:04:03 -0800, "Eric"
    <Eric@discussions.microsoft.com> wrote:

    >Hi Sue,
    >
    >I' not getting any error per se but rather undesirable results by running
    >Alter Database with Set Restricted_User.
    >
    >When I run this command:
    >
    >Alter Database dbname Set Restricted_User With Rollback Immediate
    >
    >it logs off everyone including sysadmins and db_owners. Is there a way to
    >log out everyone except sysadmins and or db_owners?
    >
    >Cheers
    >Eric
    >
    >"Sue Hoegemeier" wrote:
    >
    >> And the difficulty you are having is what exactly? What is
    >> the error? Does the database go into restricted_user mode?
    >> Are you closing the connection after you execute the
    >> statement?
    >> On a side note, if you are doing this with an login that is
    >> a sysadmin, you don't need to add that login to db_owners.
    >> Sysadmins can access a database that is in restricted_user
    >> mode.
    >>
    >> -Sue
    >>
    >> On Tue, 9 Nov 2004 19:52:01 -0800, "Eric"
    >> <Eric@discussions.microsoft.com> wrote:
    >>
    >> >Hi there,
    >> >
    >> >I'm having difficulty trying to lock a databse so as to prevent people from
    >> >logging in, and at the same time, not logging myself out. The following
    >> >statement allows me to lock the db, however, it also logs me out at the same
    >> >time.
    >> >
    >> >Alter Database dbname Set Restricted_User With Rollback Immediate
    >> >
    >> >I have created a separate executable through VB that locks and unlocks, and
    >> >is executed from within another application. This application uses the SQL
    >> >Server as the backend. I need to log into the application first using a
    >> >system admin account that also has db_owner rights, and then perform locking,
    >> >and still remain logged into the db.
    >> >
    >> >Using the statement above, the db_owner will still have access to the db,
    >> >but how do I ensure that the statement does not log me out as soon as I
    >> >execute it?
    >> >
    >>
    >>


  • Next message: Yaron: "Re: Change password to sa user from remote client"

    Relevant Pages

    • [Full-Disclosure] Advanced usage of system() function.
      ... and call its arguments as a command for shell. ... as we can see we still didnt get what we want (typing exit ... Connection closed by foreign host. ... think what we want to execute. ...
      (Full-Disclosure)
    • Advanced usage of system() function.
      ... and call its arguments as a command for shell. ... as we can see we still didnt get what we want (typing exit we are ... Connection closed by foreign host. ... think what we want to execute. ...
      (Bugtraq)
    • Re: ADODB Command memory leak
      ... _ConnectionPtr conn = NULL; ... // Execute statement. ... > My logic is such that the connection to the database is not maintained ... Create/Append command parameters ...
      (microsoft.public.data.ado)
    • Re: Please Urgent - Update Data Source Problem ???
      ... then there's nothing to submit to the database. ... values that are only assigned by the DB once the update command is executed. ... > the connection. ... > schedule, and they can update the existing schedule, add new schedule ...
      (microsoft.public.dotnet.framework.compactframework)
    • Re: SET IDENTITY_INSERT tablename ON problem
      ... Try to do next - run SQL profiler and see if ADO Command ... Another way is to use Execute method of ADO connection. ... > database I add a new tmp table with the new structure. ...
      (microsoft.public.vb.database.ado)