Re: SQL Server does not exist or access denied.

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: William Ryan eMVP (dotnetguru_at_comcast.nospam.net)
Date: 05/10/04


Date: Mon, 10 May 2004 09:47:21 -0400

This is the code from the properties window that he posted:
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=temp;Data Source=sysdev\vsdotnet;Use
Procedure for Prepare=1;Auto Translate=True;Packet
Size=4096;Workstation ID=SYSDEV;Use Encryption for Data=False;Tag with
column collation when possible=False

He may be using another one but I can't tell that for sure. If he was using
SSPI, that would explain why the username is seen in the exception but not
he connection string.

HTH,

Bill
www.devbuzz.com
www.knowdotnet.com

"Andy Gaskell" <pubb AT hotmail DOT com> wrote in message
news:#$9eypkNEHA.1312@TK2MSFTNGP12.phx.gbl...
> If you look at the exception text he's not using SSPI, correct?
>
> "conPubs = new
>
SqlConnection("Server=sysdev\vsdotnet;uid=bob;pwd=isgood;database=temp" );"
>
>
> "William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
> news:%23BdEhKkNEHA.3348@TK2MSFTNGP09.phx.gbl...
> > you're using SSPI so you need to use the asp_net account and make sure
it
> > has permissions. Otherwise, change the context and pass in a valid
> username
> > and password for the db. Verify the asp account has the permissions
> granted
> > too.
> >
> > HTH,
> >
> > Bill
> >
> > www.devbuzz.com
> > www.knowdotnet.com
> >
> > "Bob" <clarke@qualitythink.com> wrote in message
> > news:cfa521f2.0405091853.a1ae224@posting.google.com...
> > > Having trouble getting started.
> > >
> > > I created an instance of MSDE called VSDOTNET on a computer with the
> > > name of sysdev.
> > >
> > > Using MS SQL Web Adminstrator I created a database called temp with a
> > > table called customer.
> > >
> > > In Visual Studio .NET I can see and access the data in the table. The
> > > dataconnection is called sysdev\vsdotnet\temp.dbo
> > >
> > > The connection string in the properties window is:
> > > Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
> > > Info=False;Initial Catalog=temp;Data Source=sysdev\vsdotnet;Use
> > > Procedure for Prepare=1;Auto Translate=True;Packet
> > > Size=4096;Workstation ID=SYSDEV;Use Encryption for Data=False;Tag with
> > > column collation when possible=False
> > >
> > > However with an application (this case a webform, .aspx) I can not
> > > access the data. I keep getting the error message below.
> > >
> > > Any help with why this doesn't work?
> > >
> > >
> > > Server Error in '/' Application.
> >
>
> --------------------------------------------------------------------------
> > ------
> > >
> > > SQL Server does not exist or access denied.
> > > Description: An unhandled exception occurred during the execution of
> > > the current web request. Please review the stack trace for more
> > > information about the error and where it originated in the code.
> > >
> > > Exception Details: System.Data.SqlClient.SqlException: SQL Server does
> > > not exist or access denied.
> > >
> > > Source Error:
> > >
> > >
> > > Line 10:
> > > Line 11: conPubs = new SqlConnection(
> > > "Server=sysdev\vsdotnet;uid=bob;pwd=isgood;database=temp" );
> > > Line 12: conPubs.Open();
> > > Line 13: cmdSelectAuthors = new SqlCommand( "Select fn From
> > > customer", conPubs );
> > > Line 14: dtrAuthors = cmdSelectAuthors.ExecuteReader();
> > >
> > >
> > > Source File: c:\inetpub\wwwroot\sqldatareader.aspx Line: 12
> > >
> > > Stack Trace:
> > >
> > >
> > > [SqlException: SQL Server does not exist or access denied.]
> > > System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
> > > isInTransaction)
> > >
> >
>
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
> > tionString
> > > options, Boolean& isInTransaction)
> > > System.Data.SqlClient.SqlConnection.Open()
> > > ASP.SqlDataReader_aspx.Page_Load(Object sender, EventArgs e) in
> > > c:\inetpub\wwwroot\sqldatareader.aspx:12
> > > System.Web.UI.Control.OnLoad(EventArgs e)
> > > System.Web.UI.Control.LoadRecursive()
> > > System.Web.UI.Page.ProcessRequestMain()
> >
> >
>
>



Relevant Pages

  • Re: Getting Database Error Number
    ... need for exceptions with higher severity number). ... HTH, ... Bill ... or else how the exception can beused to get ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: Error when attaching multiple files (System.web.mail)
    ... Settings folder on your machine to the authenticated domain user account. ... Try to give permissions to ASPNET user account on the local folder where ... you are storing your attachments. ... > following exception. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: RWW
    ... Were the permissions correct, or did you have to adjust them? ... >> Add Local Service and Network Service account Read & Execute, ... >>> current web request. ... >>> Exception Details: System.UnauthorizedAccessException: Access to the ...
    (microsoft.public.windows.server.sbs)
  • Re: how can I run .net logon script application
    ... What about the other exception? ... > CodeBase: ... >> A PolicyException can be addressed by adjusting the CAS policy. ... >> Windows permissions to run your code, ...
    (microsoft.public.dotnet.security)
  • Re: Checking if a file exists regardless of the permissions on it
    ... "Exception based programming" ... ... false if I do not have necessary permissions. ... If it did then an application could request information from your system and ... it'll probably be an access rights or sharing issue. ...
    (microsoft.public.dotnet.languages.csharp)