<HTML>
<HEAD>
<TITLE>ADO简例</TITLE>
</HEAD>
<BODY>
<%
Set adoConn = Server.CreateObject("ADODB.Connection")
adoConn.Open "PROVIDER=SQLOLEDB; DATA SOURCE=DBServer;
UID=sa; PWD=; DATABASE=employee"
Set adoRS = Server.CreateObject("ADODB.Recordset")
adoRs.ActiveConnection = adoConn
adoRS.Open "select * from employee"
%>
<TABLE WIDTH=100%>
<TR><TD>
NAME
</TD><TD>
AGE
</TD><TD>
PHONE
</TD></TR>
<% do while not adors.eof %>
<TR><TD>
<% = adors("name") %>
</TD><TD>
<% = adoRs("age") %>
</TD><TD>
<% = adoRs("phone") %>
</TD></TR>
<%
adors.movenext
loop
%>
</TABLE>
<%
adoRs.Close
Set adoRs = nothing
adoConn.Close
Set adoConn = nothing
%>
</BODY>
</HTML>