%@ LANGUAGE="VBSCRIPT" %> <% ' -- Declare Variables Dim objConn ' Our Connection Object Dim objRS ' Our Recordset Object Dim strSQL ' Our SQL String to access the database Dim strConnection ' Our Connection string to access the database Dim i ' a counter variable ' -- Create objects Set objConn = Server.CreateObject("ADODB.Connection") Set objRS = Server.CreateObject("ADODB.Recordset") ' -- Connection String Value strConnection = "DSN=Shiva_URLDesc;uid=sa;PWD=sgmkj;APP=ASP Script;DATABASE=hazoosites" ' -- Open the Connection objConn.Open strConnection ' -- Our SQL Statement strSQL = "SELECT * FROM reference" ' -- Populate our Recordset with data set objRS = objConn.Execute (strSQL) if (objRS.BOF and objRS.EOF) then response.write "No records found" response.end End if '---------------------------------------------------------------------- ' Begin HTML output '---------------------------------------------------------------------- %>
| " & objRS.Fields(i).Name & " | " Next Response.write "|
|---|---|
| " & URLstr & " | ") Response.Write "" & Descstr & " | " Next Response.write "