<%@ 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 '---------------------------------------------------------------------- %> Kidsnet sites for References <% ' -- Output the Field Names as the first row in the table Response.Write "" For i = 0 to objRS.Fields.Count - 1 Response.Write "" Next Response.write "" ' -- Now output the contents of the Recordset objRS.MoveFirst Do While Not objRS.EOF ' -- output the contents Response.Write "" For i = 0 to objRS.Fields.Count - 2 URLstr = objRS.Fields(0) Descstr = objRS.Fields(1) Response.Write("") Response.Write "" Next Response.write "" ' -- move to the next record objRS.MoveNext Loop objRS.Close set objRS = Nothing objConn.Close set objConn = Nothing %>
" & objRS.Fields(i).Name & "
" & URLstr & "" & Descstr & "
<% '---------------------------------------------------------------------- ' End HTML Output '---------------------------------------------------------------------- '---------------------------------------------------------------------- ' All ASP post processing code goes here, as well as ' sub routines and functions '---------------------------------------------------------------------- %>