<% on error resume next attempt="create connection object" set conntemp=server.createobject("adodb.connection") Call ErrorVBScriptReport(attempt) attempt="opening DSN" conntemp.open "DSN=Student;uid=student;pwd=magic" Call ErrorVBScriptReport(attempt) Call ErrorADOReport(attempt,conntemp) attempt="select * from authors where AU_ID<16" set rstemp=conntemp.execute(attempt) Call ErrorVBScriptReport(attempt) Call ErrorADOReport(attempt,conntemp) If rstemp.eof then response.write "No records matched your query" & "

" response.write attempt response.end end if attempt="counting fields" howmanyfields=rstemp.fields.count -1 Call ErrorVBScriptReport(attempt) Call ErrorADOReport(attempt,conntemp) %> <% 'Put Headings On The Table of Field Names for i=0 to howmanyfields %> <% next %> <% ' Now lets grab all the records do while not rstemp.eof %> <% for i = 0 to howmanyfields%> <% next %> <% rstemp.movenext loop rstemp.close set rstemp=nothing conntemp.close set conntemp=nothing %>
<%=rstemp(i).name %>
<%=rstemp.fields(i)%>