We already have connection string in a file conn.asp at the root of the server and we include them by using include virtual command. So at the top of the file we will fist read the common connection file to get the connection string. Here we will also include adovbc.inc file
We will fist establish the connection and once the connection is open then we will declare a recordset object. The recordset object will use the query to collect the records. Then we will use one Do While loop to display one by one all the records. At the starting of each iteration of the while loop we will check the end of file condition EOF is true or not , if record exist then EOF will be false so we will take the NOT condition of this and execute the code inside the loop to display a record. At the end of each loop we will move recordset pointer by one step by using MoveNext command.
Here is the complete code to display the records.
<%@ Language=VBScript %>
<% Option Explicit %>
<!-- #include virtual = "/adovbs.inc" -->
<!-- #include virtual = "/conn.asp" -->
<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<title>(Type a title for your page here)</title>
</head>
<body >
<%
Dim conn,rs,rs1,SQL,RecsAffected
Set conn=Server.CreateObject("ADODB.Connection")
conn.Mode=adModeRead
conn.ConnectionString = aConnectionString
conn.Open
Set rs1 =Server.CreateObject("ADODB.Recordset")
''Dim
''Response.Write "userid="&userid
rs1.open "select * from dt", conn
Do While Not rs1.EOF
Response.Write rs1("issue_dt")
Response.Write "<br>"
rs1.MoveNext
Loop
Set rs1 = Nothing
conn.Close
Set conn = Nothing
%>
</body>
</html>