I have an old ASP app that I have had to migrate to use SQL Server 2005. I have two pages that are virtually identical (one is edit only the other makes provision for adding new records - I didn't write these apps but I am responsible for making them work now). One page connect successfully to the SQL Server Instance and the other does not. They are using EXACTLY the same connect string.
The only weird thing that has transpired is that we migrated to Active Directory recently. The ASP app that connects successfully was already on the web server prior to AD migration. The one that does not connect successfully was migrated after AD migration.
Further, the app that does not connect correctly when it is installed on my production web server does connect correctly when I am running it under IIS on my local development machine.
Anyone have any ideas about what could be wrong here? I'm suspecting that some credentialing issue is the problem as the big difference on the production web server is that the app that connects correctly from there was there pre AD migration and the app that does not connect correctly was not.
several questions:
1) Can you post your connection string here?
2) Did you get any error message?
3) Is you IIS server on the same box as your SQL Server?
Thanks.
|||The SQL Server instance is running behind a firewall on a fairly beefy Win 2003 server. The IIS server is a separate machine on WIN 2003 Server behind the same firewall.
The error message I get is as follows:
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
/jblol/od_sheets_edit/Od_sheets.asp, line 32
Here is the connection string section that will not connect (of course uid and pwd are changed to protect the guilty).
<%@. Language=VBScript %>
<!--#Include File = "Resources/adovbs.inc"-->
<script LANGUAGE="vbscript">
<!--
Sub button2_onclick
if FORM1.selORGANIZATION.value = "" then
msgbox "You must first select a location"
Exit Sub
End If
if FORM1.txtPart.value = "" then
msgbox "You must provide an Item Number"
Exit Sub
End If
FORM1.action = "QueryPart.asp"
FORM1.submit
End Sub
-->
</script>
<html>
<%
Dim rst, conn, strDeptText, strOperation
'Here's Where we will Customize Which Group of Data we are Querying........
strOperation = Request.QueryString("txtOperation")
Set conn = Server.CreateObject("ADODB.Connection")
Set rst = server.CreateObject("ADODB.Recordset")
conn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=XXXXXX;Password=XXXXXX;Initial Catalog=OD_Sheets;Data Source=TSD0N1D01/TSDSQL200501"
conn.Open
Here is the section of pretty identical code that does connect properly.
<!--#Include File = "Resources/adovbs.inc"-->
<script LANGUAGE="vbscript">
<!--
Sub button2_onclick
if FORM1.selORGANIZATION.value = "" then
msgbox "You must first select a location"
Exit Sub
End If
if FORM1.txtPart.value = "" then
msgbox "You must provide a Item Number"
Exit Sub
End If
FORM1.action = "QueryPart.asp"
FORM1.submit
End Sub
-->
</script>
<html>
<%
Dim rst, conn, strDeptText, strOperation
'Here's Where we will Customize Which Group of Data we are Querying........
strOperation = Request.QueryString("txtOperation")
Set conn = Server.CreateObject("ADODB.Connection")
Set rst = server.CreateObject("ADODB.Recordset")
conn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=XXXXXX;Password=XXXXXX;Initial Catalog=OD_Sheets;Data Source=TSD0N1D01\TSDSQL200501"
conn.Open
%>
|||You know, it looks to me as if this must somehow be trying to execute an older version of this page that is perhaps in a cache or something. These things are identical and it makes no sense that one would connect just fine and one would not. I'm going to pursue that idea and see if it goes anywhere.|||for the first one: should be:
--Data Source=TSD0N1D01\TSDSQL200501--
rather then:
--Data Source=TSD0N1D01/TSDSQL200501--
Please confirm if this fix your problem.
Thanks,
|||Duh, how stupid am I. That was the problem.
Steve Wells - the stupidest programmer who manages to still stay employed despite it
No comments:
Post a Comment