Hi i am trying to connect to MS-SQLSERVER-2008 from asp. when i am running the asp page. i am getting this error
Error:
An error occurred on the server when processing the URL. Please contact the system administrator.
What is the cause for this error. and is anything wrong in my code causing this error?
code:
<html>
<head>
</head>
<body>
<%
Dim Connection
Dim Recordset
Dim SQL
Set Connection = Server.CreateObject("ADODB.Connection")
Set Recordset = Server.CreateObject("ADODB.Recordset")
Connection.open "Driver={SQL Server};Server=127.0.0.1;Database=products;UID=sa;PWD=sa","sa","sa"
SQL = "SELECT * FROM dbo.products_images"
Recordset.Open SQL,Connection;
If Recordset.EOF Then
Response.Write("No records returned.")
Else
Do While NOT Recordset.Eof
Response.write Recordset("ID")
Response.write Recordset("product_id")
Response.write Recordset("im_name")
Response.write Recordset("im_type")
Response.write "<br>"
Recordset.MoveNext
Loop
End If
Recordset.Close
Set Recordset=nothing
Connection.Close
Set Connection=nothing
%>
</body>
</html>
when i add below line, i am getting error.
Connection.open "Driver={SQL Server};Server=127.0.0.1;Database=products;UID=sa;PWD=sa","sa","sa"
How can i resolve this?