I am trying to build a classic ASP (not asp.net ) page that can retrieve and insert data into a database. I followed some examples online and manage to connect to my database. This is the following code in my ASP page.
<!DOCTYPE html>
<html>
<body>
<%
Set Con= CreateObject("ADODB.Connection")
Con.ConnectionString= "Provider=SQLOLEDB; Data Source=PCNAME\SQLEXPRESS;Database=testing;User ID=sa;password=abcdefg"
Con.open
if IsObject(Con) then
response.Write "The connection is active <br/>"
if Con.State=1 then
response.Write "A connection is made and is open <br/>"
end if
%>
</body>
</html>
When loaded, the asp page displays
"The connection is active A connection is made and is open"
Now, i want to create a recordset and extract data from it.
i add this snippet into my code,
set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select * from Customers", conn
But, when i load the page, i get the following results,
The connection is active A connection is made and is open An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.