Avenue
09-13-2009, 10:29 PM
Hello Everyone,
I'm brand new to classic ASP and am practicing/experimenting with a simple HTML page which calls an ASP page after a user clicks a button. When the ASP page is called, a connection to my SQL Server 2005 database is created and values from a table which i've created are supposed to be returned to a web page. The problem i'm having is that i'm getting connection errors in IE whenever I click the button.
Now here's the thing - I did what I feel is an exhaustive web search and found nothing which helps me solve this problem. Also, the connection string which i'm using to connect to my SQL Server came directly from www.connectionstrings.com. The rest of this code was developed by looking at a combination of tutorial websites, specifically W3 Schools and another at www.haneng.com
My database name is ASP_Test and the table within the database is called Name. I'm simply trying to write the records from this table to display in the body of a web page.
Here's my very simple code within the ASP page which is being called from my HTML page - nothing complex is going on here:
<%@ Language = "VBScript" %>
<HTML>
<Body>
<%
'THIS PIECE OF CODE CAME FROM CONNECTIONSTRINGS.COM
cst = "Provider=SQLOLEDB;" & _
"Data Source=W2KSQL;" & _
"Initial Catalog=ASP_Test;" & _
"Integrated Security=SSPI"
set SQLConn = CreateObject("ADODB.Connection")
SQLConn.open cst
Query = "SELECT * FROM Name"
Set RS = SQLConn.Execute(Query)
'--------
'LOOP THROUGH THE RECORDS AND DISPLAY THEM
WHILE NOT RS.EOF
%>
<LI><%=RS("FName")%>: <%=RS("LName")%>
<%
RS.MoveNext
WEND
%>
</body>
</html>
The error which i'm returning in IE is here:
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80004005)
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
/ASP/FormData.asp, line 14
Line 14 in the above code, by the way, happens to be this specific line here in my Visual Studio editor:
SQLConn.open cst
Again, i'm a newbie with ASP and just trying to get the hang of it. I'm creating this page so that we know that we can connect ASP pages to our database at work as the Devs here are migrating their Excel VBA applications over to classic ASP.
Can anyone help me troubleshoot this connection error?
Thanks!!
I'm brand new to classic ASP and am practicing/experimenting with a simple HTML page which calls an ASP page after a user clicks a button. When the ASP page is called, a connection to my SQL Server 2005 database is created and values from a table which i've created are supposed to be returned to a web page. The problem i'm having is that i'm getting connection errors in IE whenever I click the button.
Now here's the thing - I did what I feel is an exhaustive web search and found nothing which helps me solve this problem. Also, the connection string which i'm using to connect to my SQL Server came directly from www.connectionstrings.com. The rest of this code was developed by looking at a combination of tutorial websites, specifically W3 Schools and another at www.haneng.com
My database name is ASP_Test and the table within the database is called Name. I'm simply trying to write the records from this table to display in the body of a web page.
Here's my very simple code within the ASP page which is being called from my HTML page - nothing complex is going on here:
<%@ Language = "VBScript" %>
<HTML>
<Body>
<%
'THIS PIECE OF CODE CAME FROM CONNECTIONSTRINGS.COM
cst = "Provider=SQLOLEDB;" & _
"Data Source=W2KSQL;" & _
"Initial Catalog=ASP_Test;" & _
"Integrated Security=SSPI"
set SQLConn = CreateObject("ADODB.Connection")
SQLConn.open cst
Query = "SELECT * FROM Name"
Set RS = SQLConn.Execute(Query)
'--------
'LOOP THROUGH THE RECORDS AND DISPLAY THEM
WHILE NOT RS.EOF
%>
<LI><%=RS("FName")%>: <%=RS("LName")%>
<%
RS.MoveNext
WEND
%>
</body>
</html>
The error which i'm returning in IE is here:
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80004005)
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
/ASP/FormData.asp, line 14
Line 14 in the above code, by the way, happens to be this specific line here in my Visual Studio editor:
SQLConn.open cst
Again, i'm a newbie with ASP and just trying to get the hang of it. I'm creating this page so that we know that we can connect ASP pages to our database at work as the Devs here are migrating their Excel VBA applications over to classic ASP.
Can anyone help me troubleshoot this connection error?
Thanks!!