473,320 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

SQL Server Connection problem

I've created an ASP.NET application that runs on my local IIS server. It
needs to connect to a SQL Server database on a different machine. The SQL
server is setup for "mixed mode" authentication.

As you can tell from the connection string in the following code, I am using
SQL Authentication.

Dim sConn As String = "Data Source=DEV01;Initial
Catalog=Northwind;User=sa;Password=fakepw"
Dim cn As New SqlConnection(sConn)
cn.Open()

When this code executes I get the following error:

[SqlException: SQL Server does not exist or access denied.]

The exact same code WORKS if I create a Windows form application. It's only
when I run as an ASP.NET app that I have the problem.

Can you give me some direction on this?

Thanks,

Justin

Nov 18 '05 #1
5 1326
be sure to use tcp/ip rather than named pipes

-- bruce (sqlwork.com)
"Justin Ray" <go*******@hotmail.com> wrote in message
news:u3**************@TK2MSFTNGP11.phx.gbl...
I've created an ASP.NET application that runs on my local IIS server. It
needs to connect to a SQL Server database on a different machine. The SQL
server is setup for "mixed mode" authentication.

As you can tell from the connection string in the following code, I am using SQL Authentication.

Dim sConn As String = "Data Source=DEV01;Initial
Catalog=Northwind;User=sa;Password=fakepw"
Dim cn As New SqlConnection(sConn)
cn.Open()

When this code executes I get the following error:

[SqlException: SQL Server does not exist or access denied.]

The exact same code WORKS if I create a Windows form application. It's only when I run as an ASP.NET app that I have the problem.

Can you give me some direction on this?

Thanks,

Justin

Nov 18 '05 #2
Hello,

your asp.net user seems to lack sufficient rights!
Check this article:
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnnetsec/html/SecNetHT01.asp

Regards,

Tom
-----Original Message-----
I've created an ASP.NET application that runs on my local IIS server. Itneeds to connect to a SQL Server database on a different machine. The SQLserver is setup for "mixed mode" authentication.

As you can tell from the connection string in the following code, I am usingSQL Authentication.

Dim sConn As String = "Data Source=DEV01;Initial
Catalog=Northwind;User=sa;Password=fakepw"
Dim cn As New SqlConnection(sConn)
cn.Open()

When this code executes I get the following error:

[SqlException: SQL Server does not exist or access denied.]
The exact same code WORKS if I create a Windows form application. It's onlywhen I run as an ASP.NET app that I have the problem.

Can you give me some direction on this?

Thanks,

Justin

.

Nov 18 '05 #3
Since I'm not using Windows Authentication, the ASPNET user account
shouldn't be the problem, should it?

"t.********@removethis-gmx.net" <an*******@discussions.microsoft.com> wrote
in message news:19*****************************@phx.gbl...
Hello,

your asp.net user seems to lack sufficient rights!
Check this article:
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnnetsec/html/SecNetHT01.asp

Regards,

Tom
-----Original Message-----
I've created an ASP.NET application that runs on my

local IIS server. It
needs to connect to a SQL Server database on a different

machine. The SQL
server is setup for "mixed mode" authentication.

As you can tell from the connection string in the

following code, I am using
SQL Authentication.

Dim sConn As String = "Data Source=DEV01;Initial
Catalog=Northwind;User=sa;Password=fakepw"
Dim cn As New SqlConnection(sConn)
cn.Open()

When this code executes I get the following error:

[SqlException: SQL Server does not exist or access

denied.]

The exact same code WORKS if I create a Windows form

application. It's only
when I run as an ASP.NET app that I have the problem.

Can you give me some direction on this?

Thanks,

Justin

.

Nov 18 '05 #4
Bruce,

Thanks for the suggestion.

In the SQL Client Network utility, TCP/IP is listed first, followed by Named
Pipes.

I modified my connection string like this, but still had the same problem:
"Network Library=DBMSSOCN;Data Source=172.17.1.101,1433;Initial
Catalog=Northwind;User=sa;Password=fakepw"

Any other thoughts?
"bruce barker" <no***********@safeco.com> wrote in message
news:u7****************@TK2MSFTNGP09.phx.gbl...
be sure to use tcp/ip rather than named pipes

-- bruce (sqlwork.com)
"Justin Ray" <go*******@hotmail.com> wrote in message
news:u3**************@TK2MSFTNGP11.phx.gbl...
I've created an ASP.NET application that runs on my local IIS server. It needs to connect to a SQL Server database on a different machine. The SQL server is setup for "mixed mode" authentication.

As you can tell from the connection string in the following code, I am

using
SQL Authentication.

Dim sConn As String = "Data Source=DEV01;Initial
Catalog=Northwind;User=sa;Password=fakepw"
Dim cn As New SqlConnection(sConn)
cn.Open()

When this code executes I get the following error:

[SqlException: SQL Server does not exist or access denied.]

The exact same code WORKS if I create a Windows form application. It's

only
when I run as an ASP.NET app that I have the problem.

Can you give me some direction on this?

Thanks,

Justin


Nov 18 '05 #5
Ok, for the next person that has this problem, this is what I have found...

Although I'm using SQL authentication, my IIS server is still making a
server connection using whatever account it is assigned (in my case, the
IUSR_MACHINE account). I could have either used a domain account here that
had permissions on the SQL Server, or I could create a local IUSR_MACHINE
account on the database server. I chose the latter and it worked fine.

I hope this helps someone...

"Justin Ray" <go*******@hotmail.com> wrote in message
news:u3**************@TK2MSFTNGP11.phx.gbl...
I've created an ASP.NET application that runs on my local IIS server. It
needs to connect to a SQL Server database on a different machine. The SQL
server is setup for "mixed mode" authentication.

As you can tell from the connection string in the following code, I am using SQL Authentication.

Dim sConn As String = "Data Source=DEV01;Initial
Catalog=Northwind;User=sa;Password=fakepw"
Dim cn As New SqlConnection(sConn)
cn.Open()

When this code executes I get the following error:

[SqlException: SQL Server does not exist or access denied.]

The exact same code WORKS if I create a Windows form application. It's only when I run as an ASP.NET app that I have the problem.

Can you give me some direction on this?

Thanks,

Justin

Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Fortepianissimo | last post by:
Here is the situation: I want my server started up upon connection. When the first connection comes in, the server is not running. The client realizes the fact, and then starts up the server and...
4
by: Frodo | last post by:
I have a problem establishing a link between Visual Studio.NET 2003 and SQL Server 2000. Both are installed on a Windows Server 2003, standard version. Visual Studio.NET Issues...
12
by: RKay | last post by:
I have a Win2k server running SQL Server 2000. On that box I built a working web service that pulls data from the database. One of the services available simply accepts an ado.net connection string...
0
by: Suresh | last post by:
Hi Guys I have Db2 server installed on remote server. i am connecting to that remote server by using VPN. I want to connect that remote DB2 server instance using my local machine DB2...
3
by: Vinod R.Shenoy | last post by:
Hi All, Came across a post wherin you had helped somebody with a similar problem and was wondering if you could help us out with it. Our problem is , We have a development SQL Server 2000...
0
by: Kris Mattheus | last post by:
A little background: I've been using web services successfully for a while now. My web server is a Windows CE 4.2 device and my client is a windows C# application created with Visual Studio 2003....
12
by: Light | last post by:
Hi all, I posted this question in the sqlserver.newusers group but I am not getting any response there so I am going to try it on the fine folks here:). I inherited some legacy ASP codes in my...
1
by: sherifbk | last post by:
Problem description ============== - I have 4 clients and 1 server (SQL server) - 3 clients are Monitoring console 1 client is operation console - Monitoring console collects some data from...
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
5
by: marshmallowww | last post by:
I have an Access 2000 mde application which uses ADO and pass through queries to communicate with SQL Server 7, 2000 or 2005. Some of my customers, especially those with SQL Server 2005, have had...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.