VBScript Sample: vbscript/ado/adotest/adotest.asp
   ASP Script
   Comments or Client-side Script
   HTML and Text

<%  if Request("X") = "" then %>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=adotest.asp?X=1">

<%
Response.write(" <BR>")
Response.write(" <BR>")
Response.write(" <BR>")
Response.write(" <BR>")
Response.write(" <BR>")
Response.write(" <BR>")
Response.write("<CENTER><H3> Loading ADO Properties, please wait...</H3></CENTER><BR>")
%>


<%Else%>
<%  Response.Buffer = True %>

<HTML>
<HEAD><TITLE>ADO Test</TITLE></HEAD>
<BODY BGCOLOR=#FFFFFF>
<H1>ADO Test</H1>

<% 
   Set C = Server.CreateObject("ADODB.Connection")
   c.open "DSN=BIBLIO;UID=;PWD=;"
%>

<LI><FONT SIZE=4>Connection Properties</FONT>
<TABLE BORDER=1>

<% For Item = 0 To C.Properties.Count - 1 %>
<TR>
<TD><FONT SIZE=2>

<%= C.Properties(Item).Name %>
</FONT></TD>

<TD><B><FONT SIZE=2>

<%
   ' Print something so that the table border gets displayed
   If IsEmpty(C.Properties(Item)) Then
      Response.Write "  "

   ' Determine if the property is a Boolean
   End If
   If VarType(C.Properties(Item)) = 11 Then
     Response.Write CStr(CBool(C.Properties(Item)))
   Else
     Response.Write C.Properties(Item)
   End If

%>
</FONT></B></TD>
</TR>

<%  Next %>
</TABLE>
<P>
<LI><FONT SIZE=4>Resultset Properties</FONT>
<BR>


<%  Set RS = C.Execute("SELECT * FROM publishers") %>

<TABLE BORDER=1>

<% For Item = 0 To RS.Properties.Count - 1 %>

<TR>
<TD><FONT SIZE=2>
<%=RS.Properties(Item).Name%></FONT></TD>
<TD><B><FONT SIZE=2>
<%
  
' Determine if the property is a Boolean
   If VarType(RS.Properties(Item)) = 11 Then
     Response.Write CStr(CBool(RS.Properties(Item)))
   Else
     Response.Write RS.Properties(Item)
   End If
%>

</FONT></B></TD>
</TR>

<% Next %>
</TABLE>
<% RS.Close %>
<% C.Close %>

<BR>
<BR>

<% End If %>
</BODY>
</HTML>


Copyright © 1998-2002, Halcyon Software Inc. All rights reserved.