📄 recordset.asp
字号:
<%
'创建一个RecordSe对象实例
set myRecordset=Server.CreateObject("ADODB.RecordSet")
'定义用于创建RecordSe的SQL语句
sql="select * from authors where au_lname='white'"
'打开RecordSe对象,传递SQL语句和其他参数
myRecordset.Open sql,"DSN=pubs;User ID=sa"
'移动所返回的RecordSe中的记录,并把记录输出到HTML表中
%>
<Table border=1>
<TR>
<%
For I=0 to myRecordSet.Fields.count-1
%>
<Td><B>
<% =myRecordSet(I).name %>
</B> </TD>
<% next %>
</TR>
<%
do while not myRecordSet.EOF
%>
<TR>
<%
For j=0 to myRecordSet.Fields.Count-1
%>
<Td VALIGN=TOP><% =myRecordSet(j) %> </TD>
<% Next %>
</TR>
<%
myRecordSet.MoveNext
Loop
%>
</Table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -