RE: Sql Server Access Denied

From: Steve S (SteveS_at_discussions.microsoft.com)
Date: 08/09/04


Date: Mon, 9 Aug 2004 00:31:01 -0700

OK. From your interactive login, you need to run the osql utility.
If you have MSDE installed, the easiest way is to get a command prompt (cmd),
then use

osql -S. -E -d xyzzy

-S. says use local machine, -E says use 'Integrated Authentication'.
xyzzy is your database name.
You then get a '1>' prompt.
Now you can type the sp_grantlogin command, hitting Enter at the end,
then type GO and hit enter (your prompt will be '2>' at this point.
Now type the sp_grantdbaccess command in, again, hitting Enter at the end,
then type GO and hit enter (your prompt will be '2>' at this point.
Finally, type QUIT and hit enter, and your osql session should stop.

Steve S
"anonymous@discussions.microsoft.com" wrote:

> Hi Steve, Thank you so much for your reply. I did not
> specify any password for 'sa' while I installed the Sql
> Server. I am a newbie in Sql Server and this is my degree
> project. I ma not sure where to specify sp_grant access
> and grant login. Could you please be more detailed. I
> would apprecaite it. Thank you shanthi
> >-----Original Message-----
> >1. If you're using "Trusted Connection", then the user
> you connect as must
> >have database access rights to the appropriate database.
> >
> >2. If you don't use "Trusted Connection", then the
> server must be running in
> >mixed-mode security. You would then need to
> supply "UID=name;PWD=password;"
> >within the connection string.
> >
> >It works with your laptop probably because you're
> running from the same
> >interactive login you used to install MSDE, so you'll
> have dbo rights.
> >
> >You can check if it's using mixed mode by looking at a
> couple of registry
> >keys, depending on whether it's a named instance or the
> default one.
> >
> >If it's the default instance, then look in
> >
> >HKEY_LOCAL_MACHINE\Software\Microsoft\MSSqlServer\MSSqlSe
> rver
> >
> >for a value named "LoginMode". If this is 0 or 2, you
> are running in mixed
> >mode, if not, then you are running in Windows
> Authorisation mode only, which
> >means you HAVE to use trusted connections.
> >
> >As I'm not an ASP guru, I couldn't tell you which user
> it runs as, but I bet
> >someone around here knows :)
> >
> >When you installed, did you have to specify a password
> for "sa"? If not,
> >it's probably the case that you only have trusted mode
> on.
> >
> >You would need to use
> >
> >sp_grantlogin 'machine\account'
> > and
> >sp_grantdbaccess 'machine\account' 'account'
> >
> >to allow the user to connect.
> >
> >Steve S
> >
> >"shanthi" wrote:
> >
> >> I am getting the error "Sql server does not exist or
> >> access denied" when I connect an asp application and
> sql
> >> server through an oledb connection. The connection
> string
> >> is as follows:
> >>
> >> Set cnnStoredProc = Server.CreateObject
> >> ("ADODB.Connection")
> >> cnnStoredProc.Open "Provider=SQLOLEDB;Initial
> >> Catalog=name of the database;Data Source=server
> >> name;Trusted_Connection=yes"
> >> The same string works fine in my laptop when I try
> >> connect asp and msde on my laptop. I also tried to
> change
> >> the connection staring with various parameters for
> >> example I tried to use IP address instead server name
> and
> >> tried specifying the port number too(1433), I tried
> using
> >> Trusted Connection value to be True/False/No. Nothing
> >> seems to work. Pls help me .
> >>
> >> Thanks in advance
> >> Shanthi
> >>
> >.
> >
>



Relevant Pages

  • RE: Vista Network Map
    ... I have entered the string as you explained into the Adminisrator Command ... Enter the string into the coomand prompt that is open at an elevated level ... If you install the LLTD before you install SP3, ... In the folder where you extract to you will find a folder SP2QFE. ...
    (microsoft.public.windows.vista.networking_sharing)
  • Re: electricity turned off during the installation of update
    ... Assure yourself that all new material or software were install correctly. ... If you need to used the no error mode to suppress or desactivate the ... I tried the command prompt, the no-error mode, the debug, last good ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Installing services with startup type auto from command prompt
    ... How do I install the service with startup type auto in the starting ... The info which appears when I type "instsrv" at the command ... prompt doesn't tell me anything about that. ...
    (microsoft.public.win2000.general)
  • Re: Installation of Debian by disk
    ... Debian has an underlying command line base, on top of which you can put ... As you are in a command line prompt it looks as ... you probably didn't install it. ...
    (Debian-User)
  • Re: Windows could not start because the following file is missing or corrupt: System32DriversNtfs.sy
    ... And perform a chkdsk /f on the slave sdrive, ... Using the F10 option, once you get to the C: prompt, put the floppy ... Alt and D keys at the same time to go to a command prompt. ...
    (microsoft.public.windowsxp.general)

Loading