HighTechTalks DotNet Forums  

SQL Server connection string works with IIS 5.1 but not IIS 6 in ASP.NET

ASP.net Web Services microsoft.public.dotnet.framework.aspnet.webservices


Discuss SQL Server connection string works with IIS 5.1 but not IIS 6 in ASP.NET in the ASP.net Web Services forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
John Kennedy
 
Posts: n/a

Default SQL Server connection string works with IIS 5.1 but not IIS 6 in ASP.NET - 08-13-2003 , 11:46 AM






Hello,

I have a very simple aspx file that runs on WinXP Pro IIS 5.1 and connects
to a SQL Server 2k DB running on a Win2003 Server box. It works fine with
the connection string below (X replace real values for security).
"packet size=4096;user id=XXX;pwd=XXX;data source='XX.XXX.XXX.X';persist
security info=False;initial catalog=XXX"

When I place this aspx file on the Win2003 Server under a Virtual Directory
I get the following error.

"SQL Server does not exist or access denied"

I have replaced the IP address for the data source value in the original
connection string with every imaginable option (local, localhost,
<servername\sqlservername>, etc.) to no avail.

I have added ASPNET, NETWORK SERVICES, & SYSTEM as logins to the SQL Server
and the database I am trying to access. I have modified my <processModel
section of the machine.config file to use the SYSTEM user name.

Does anyone have any idea what is going on?

Thank you ahead of time for your suggestions.

John



Reply With Quote
  #2  
Old   
Carl Prothman [MVP]
 
Posts: n/a

Default Re: SQL Server connection string works with IIS 5.1 but not IIS 6 in ASP.NET - 08-13-2003 , 12:18 PM






"John Kennedy" <jfk (AT) geopraxis (DOT) com> wrote
Quote:
I have a very simple aspx file that runs on WinXP Pro IIS 5.1 and connects
to a SQL Server 2k DB running on a Win2003 Server box. It works fine with
the connection string below (X replace real values for security).
"packet size=4096;user id=XXX;pwd=XXX;data source='XX.XXX.XXX.X';persist
security info=False;initial catalog=XXX"
When I place this aspx file on the Win2003 Server under a Virtual Directory
I get the following error.
"SQL Server does not exist or access denied"
I have replaced the IP address for the data source value in the original
connection string with every imaginable option (local, localhost,
servername\sqlservername>, etc.) to no avail.
I have added ASPNET, NETWORK SERVICES, & SYSTEM as logins to the SQL Server
and the database I am trying to access. I have modified my <processModel
section of the machine.config file to use the SYSTEM user name.

John,
Is SQL Server setup for Mix Secuirty mode?

Do you have an evaluation copy of SQL Server 2000 which expired?

Is the connecton timeout set too short?

Are you using the SqlConnection object?

Also, did you turn off connection pooling?
http://support.microsoft.com/default.aspx?scid=kb;en-us;328476

Try adding the SQL Server port number to the IP address to your connection string.
"Data Source=xxx.xxx.xxx.xxx,1433"
(use the port number your SQL Server is setup for. Default is 1433)

Try adding the TCP/IP network library to your connection string
"Network Library=DBMSSOCN"
http://www.able-consulting.com/dotnet/adonet/Data_Providers.htm#SQLClientManagedProviderIP

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com





Reply With Quote
  #3  
Old   
John Kennedy
 
Posts: n/a

Default Re: SQL Server connection string works with IIS 5.1 but not IIS 6 in ASP.NET - 08-13-2003 , 01:09 PM



Carl,

Thanks for the response. I answered your specific questions below. We have
tried everthing you suggested with no luck in solving this issue. The MSDN
lines are all busy, so these newsgroups are our only hope until this worm
support issue eases up a bit.

John

"Carl Prothman [MVP]" <carlpr (AT) spamcop (DOT) net> wrote

Quote:
"John Kennedy" <jfk (AT) geopraxis (DOT) com> wrote
I have a very simple aspx file that runs on WinXP Pro IIS 5.1 and
connects
to a SQL Server 2k DB running on a Win2003 Server box. It works fine
with
the connection string below (X replace real values for security).
"packet size=4096;user id=XXX;pwd=XXX;data source='XX.XXX.XXX.X';persist
security info=False;initial catalog=XXX"
When I place this aspx file on the Win2003 Server under a Virtual
Directory
I get the following error.
"SQL Server does not exist or access denied"
I have replaced the IP address for the data source value in the original
connection string with every imaginable option (local, localhost,
servername\sqlservername>, etc.) to no avail.
I have added ASPNET, NETWORK SERVICES, & SYSTEM as logins to the SQL
Server
and the database I am trying to access. I have modified my <processModel
section of the machine.config file to use the SYSTEM user name.


John,
Is SQL Server setup for Mix Secuirty mode?
Authentication is set to SQL and Windows.

Quote:
Do you have an evaluation copy of SQL Server 2000 which expired?
This is an MSDN Univ. sub. version of SQL Server 2000. This page works
remotely connecting to this database. Would that work if it was a license
expiration issue?

Quote:
Is the connecton timeout set too short?
I have tried 90 seconds as well. Why would it work remotely on IIS 5.1 with
a 30 second timeout and not locally with a 90 second?

Quote:
Are you using the SqlConnection object?
Yes. The .NET framework version.

Quote:
Also, did you turn off connection pooling?
http://support.microsoft.com/default.aspx?scid=kb;en-us;328476
No I don't think so. This is a fresh out of the box install. Everything is
set to what ever the defaults are.

Quote:
Try adding the SQL Server port number to the IP address to your
connection string.
"Data Source=xxx.xxx.xxx.xxx,1433"
(use the port number your SQL Server is setup for. Default is 1433)
We tried this and had the same result. It works remotely without the port
number added.

Quote:
Try adding the TCP/IP network library to your connection string
"Network Library=DBMSSOCN"

http://www.able-consulting.com/dotnet/adonet/Data_Providers.htm#SQLClientManagedProviderIP

We tried this and had the same result.

Quote:
--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com






Reply With Quote
  #4  
Old   
Carl Prothman [MVP]
 
Posts: n/a

Default Re: SQL Server connection string works with IIS 5.1 but not IIS 6 in ASP.NET - 08-13-2003 , 01:59 PM



"John Kennedy" <jfk (AT) geopraxis (DOT) com> wrote
Quote:
We have
tried everthing you suggested with no luck in solving this issue. The MSDN
lines are all busy, so these newsgroups are our only hope until this worm
support issue eases up a bit.

John,
The only other suggestions I have is to review the following KB articles and
make sure you have everything setup correctly

INF: Potential Causes of the "SQL Server Does Not Exist or Access Denied" Error Message
http://support.microsoft.com/default.aspx?scid=kb;en-us;328306

HOW TO: Configure SQL Server Security for .NET Applications
http://support.microsoft.com/default.aspx?scid=kb;en-us;815154

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com






Reply With Quote
  #5  
Old   
John Kennedy
 
Posts: n/a

Default Re: SQL Server connection string works with IIS 5.1 but not IIS 6 in ASP.NET - 08-13-2003 , 06:35 PM



Carl,

I was able to solve the problem with help from MSDN support.

One of the items I tried earlier actually fixed the issue what kept it from
working is that I was editing my connection string on this test page in the
actual *.vb file on the server. This sort of edit requires a recompile which
I did not realize. I recompiled and updated the bin\*.dll file and it was
solved. Made the change in the actual app's web.config file and it worked.

I was using old asp file habits of editing code on the server that is
implemented immediately. Not so with ASP.NET. I wish MS made that a clear
distinction in their What's new marketing. None of our developers realized
that. BIG difference between asp and asp.net.

John

"Carl Prothman [MVP]" <carlpr (AT) spamcop (DOT) net> wrote

Quote:
"John Kennedy" <jfk (AT) geopraxis (DOT) com> wrote
We have
tried everthing you suggested with no luck in solving this issue. The
MSDN
lines are all busy, so these newsgroups are our only hope until this
worm
support issue eases up a bit.


John,
The only other suggestions I have is to review the following KB articles
and
make sure you have everything setup correctly

INF: Potential Causes of the "SQL Server Does Not Exist or Access Denied"
Error Message
http://support.microsoft.com/default.aspx?scid=kb;en-us;328306

HOW TO: Configure SQL Server Security for .NET Applications
http://support.microsoft.com/default.aspx?scid=kb;en-us;815154

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com







Reply With Quote
  #6  
Old   
Carl Prothman [MVP]
 
Posts: n/a

Default Re: SQL Server connection string works with IIS 5.1 but not IIS 6 in ASP.NET - 08-13-2003 , 07:15 PM



"John Kennedy" <jfk (AT) geopraxis (DOT) com> wrote
Quote:
I was able to solve the problem with help from MSDN support.

Cool! I'm glad to hear that you got it solved!

Quote:
One of the items I tried earlier actually fixed the issue what kept it from
working is that I was editing my connection string on this test page in the
actual *.vb file on the server. This sort of edit requires a recompile which
I did not realize. I recompiled and updated the bin\*.dll file and it was
solved. Made the change in the actual app's web.config file and it worked.

Correct, use the web.config for all your configuration needs...

Quote:
I was using old asp file habits of editing code on the server that is
implemented immediately. Not so with ASP.NET. I wish MS made that a clear
distinction in their What's new marketing. None of our developers realized
that. BIG difference between asp and asp.net.

Yup, if you stay with the code-behind model (which is the default in Visual
Studio .NET), then you will need to recompile the DLL if you make changes
to the code-behind.

However, you can use in-line code (e.g. download Web Matrix from
www.asp.net). If you add a button to the form in that tool and double-click
on it, then it creates in-line code (at the top of the aspx file). You can then make
changes to the in-line code in the ASPX file (since it gets compile at run time)
without having to recompile any DLL. Food for thought... ;-)

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com






Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.