Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: SqlConnection.Open() permission denied for remote sql server

Reply
Thread Tools

Re: SqlConnection.Open() permission denied for remote sql server

 
 
Kevin Spencer
Guest
Posts: n/a
 
      08-15-2003
Is the SQL Server using Windows Authentication or SQL Server authentication?
What does your Connection String look like? And what is the exact
"permission denied message?"

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"Elin Asphjell" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> I'm developing a web application in dotnet/csharp that connects to a sql
> server using the SqlConnection object. The problem is that I cant open a
> connection to the database when it is located on a different computer than
> the webserver. I get a permission denied message. When I move the connect
> code into a consol application , I can open the connection. So I guess the
> asp.net user has too few permissions? Can someone help me? The web
> application has security set to anonymous access and the intecrated

security
> checkbox is checked.
>
> Regards
> Elin Kolloen
>
>



 
Reply With Quote
 
 
 
 
Elin Asphjell
Guest
Posts: n/a
 
      08-15-2003
The SQL server has both windows authentication and sql server authentication
enabled. I'm sending the sql server login id and password in the
connectionstring. The connectionstring looks like this:
"Data Source=SERVERNAME;Inital Catalog=DATABASENAME;User
ID=LOGINNAME;Password=PASSWORD". The error message is:
"System.Data.SqlClient.SqlException: SQL Server does not exist or access
denied." Since I know the server exists and I can connect with my consol
app, I'm guessing it's a permissions problem.

Regards
Elin Kolloen

"Kevin Spencer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is the SQL Server using Windows Authentication or SQL Server

authentication?
> What does your Connection String look like? And what is the exact
> "permission denied message?"
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> http://www.takempis.com
> Neither a follower nor a lender be.
>
> "Elin Asphjell" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi
> >
> > I'm developing a web application in dotnet/csharp that connects to a sql
> > server using the SqlConnection object. The problem is that I cant open a
> > connection to the database when it is located on a different computer

than
> > the webserver. I get a permission denied message. When I move the

connect
> > code into a consol application , I can open the connection. So I guess

the
> > asp.net user has too few permissions? Can someone help me? The web
> > application has security set to anonymous access and the intecrated

> security
> > checkbox is checked.
> >
> > Regards
> > Elin Kolloen
> >
> >

>
>



 
Reply With Quote
 
 
 
 
Elin Asphjell
Guest
Posts: n/a
 
      08-15-2003
That was a helpful tip, thank you. I have now used the profiler and found
that there is no attempt to login when I run my web application. My consol
application leads to a succesfully login. Since I run these two application
from the same computer, it is not just a network problem. The only
difference is that the web application runs as the anonymous user/asp.net
user, and the consol application runs as the logged on domain user (my
account). So I'm back to permissions again, and hope someone can help me.

Regards
Elin Kolloen


"Kevin Spencer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The error message indicates that one of two possible things happened:
>
> 1. The Login Failed
> 2. A Network issue prevented the request from reaching the SQL Server.
>
> It is a relatively simple matter to find out if the login failed (which
> isn't likely in your case, because it can connect to the same machine's

SQL
> Server, which I presume is set up the same?). In any case, you can set up
> SQL Profiler on the target machine to audit logins. If you do this, and

run
> your app, you will see whether or not the login was attempted. If not,

it's
> a network issue.
>
> If it is a network issue, it could one of several possibilities. Your best
> bet in that case would be to talk with your Network Admin about the

problem.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> http://www.takempis.com
> Neither a follower nor a lender be.
>
> "Elin Asphjell" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > The SQL server has both windows authentication and sql server

> authentication
> > enabled. I'm sending the sql server login id and password in the
> > connectionstring. The connectionstring looks like this:
> > "Data Source=SERVERNAME;Inital Catalog=DATABASENAME;User
> > ID=LOGINNAME;Password=PASSWORD". The error message is:
> > "System.Data.SqlClient.SqlException: SQL Server does not exist or access
> > denied." Since I know the server exists and I can connect with my consol
> > app, I'm guessing it's a permissions problem.
> >
> > Regards
> > Elin Kolloen
> >
> > "Kevin Spencer" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Is the SQL Server using Windows Authentication or SQL Server

> > authentication?
> > > What does your Connection String look like? And what is the exact
> > > "permission denied message?"
> > >
> > > --
> > > HTH,
> > >
> > > Kevin Spencer
> > > Microsoft MVP
> > > .Net Developer
> > > http://www.takempis.com
> > > Neither a follower nor a lender be.
> > >
> > > "Elin Asphjell" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > Hi
> > > >
> > > > I'm developing a web application in dotnet/csharp that connects to a

> sql
> > > > server using the SqlConnection object. The problem is that I cant

open
> a
> > > > connection to the database when it is located on a different

computer
> > than
> > > > the webserver. I get a permission denied message. When I move the

> > connect
> > > > code into a consol application , I can open the connection. So I

guess
> > the
> > > > asp.net user has too few permissions? Can someone help me? The web
> > > > application has security set to anonymous access and the intecrated
> > > security
> > > > checkbox is checked.
> > > >
> > > > Regards
> > > > Elin Kolloen
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      08-15-2003
If it's not reaching the SQL Server, it's a Network issue. Could be Network
permissions, but the Network is what is blocking the call. Again, I
recommend you talk with your Network Admin.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"Elin Asphjell" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> That was a helpful tip, thank you. I have now used the profiler and found
> that there is no attempt to login when I run my web application. My consol
> application leads to a succesfully login. Since I run these two

application
> from the same computer, it is not just a network problem. The only
> difference is that the web application runs as the anonymous user/asp.net
> user, and the consol application runs as the logged on domain user (my
> account). So I'm back to permissions again, and hope someone can help me.
>
> Regards
> Elin Kolloen
>
>
> "Kevin Spencer" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > The error message indicates that one of two possible things happened:
> >
> > 1. The Login Failed
> > 2. A Network issue prevented the request from reaching the SQL Server.
> >
> > It is a relatively simple matter to find out if the login failed (which
> > isn't likely in your case, because it can connect to the same machine's

> SQL
> > Server, which I presume is set up the same?). In any case, you can set

up
> > SQL Profiler on the target machine to audit logins. If you do this, and

> run
> > your app, you will see whether or not the login was attempted. If not,

> it's
> > a network issue.
> >
> > If it is a network issue, it could one of several possibilities. Your

best
> > bet in that case would be to talk with your Network Admin about the

> problem.
> >
> > --
> > HTH,
> >
> > Kevin Spencer
> > Microsoft MVP
> > .Net Developer
> > http://www.takempis.com
> > Neither a follower nor a lender be.
> >
> > "Elin Asphjell" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > The SQL server has both windows authentication and sql server

> > authentication
> > > enabled. I'm sending the sql server login id and password in the
> > > connectionstring. The connectionstring looks like this:
> > > "Data Source=SERVERNAME;Inital Catalog=DATABASENAME;User
> > > ID=LOGINNAME;Password=PASSWORD". The error message is:
> > > "System.Data.SqlClient.SqlException: SQL Server does not exist or

access
> > > denied." Since I know the server exists and I can connect with my

consol
> > > app, I'm guessing it's a permissions problem.
> > >
> > > Regards
> > > Elin Kolloen
> > >
> > > "Kevin Spencer" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > Is the SQL Server using Windows Authentication or SQL Server
> > > authentication?
> > > > What does your Connection String look like? And what is the exact
> > > > "permission denied message?"
> > > >
> > > > --
> > > > HTH,
> > > >
> > > > Kevin Spencer
> > > > Microsoft MVP
> > > > .Net Developer
> > > > http://www.takempis.com
> > > > Neither a follower nor a lender be.
> > > >
> > > > "Elin Asphjell" <(E-Mail Removed)> wrote in message
> > > > news:(E-Mail Removed)...
> > > > > Hi
> > > > >
> > > > > I'm developing a web application in dotnet/csharp that connects to

a
> > sql
> > > > > server using the SqlConnection object. The problem is that I cant

> open
> > a
> > > > > connection to the database when it is located on a different

> computer
> > > than
> > > > > the webserver. I get a permission denied message. When I move the
> > > connect
> > > > > code into a consol application , I can open the connection. So I

> guess
> > > the
> > > > > asp.net user has too few permissions? Can someone help me? The web
> > > > > application has security set to anonymous access and the

intecrated
> > > > security
> > > > > checkbox is checked.
> > > > >
> > > > > Regards
> > > > > Elin Kolloen
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Including a remote file -- permission denied? Aaron Scott Python 0 05-14-2010 07:27 PM
How to remote connect to the SQL server 2005 when th ere is a‘\’ in the SQL server name, such as 192.168.0.1 1\active? Wesley Chen Ruby 9 04-14-2009 11:36 AM
How to remote connect to the SQL server 2005 when th ere is a‘\’ in the SQL server name, such as 192.168.0.1 1\active? Wesley Chen Ruby 0 04-07-2009 10:23 AM
Help. Getting a An error has occurred while establishing a connectionto the server. When connecting to SQL Server 2005, this failure may be causedby the fact that under the default settings SQL Server does not allow remote aboutjav.com@gmail.com ASP .Net 0 05-03-2008 12:43 PM
ASP.NET SQL Server logon permission denied JT ASP .Net 2 07-05-2007 08:00 PM



Advertisments