445_1.asp
来自「ASP编程实例入门与提高书中的实例源代码」· ASP 代码 · 共 43 行
ASP
43 行
<html>
<head>
<TITLE>RecordSet的应用</TITLE>
</head>
<body bgcolor="#FFFFFF">
<%
set rstemp=Server.CreateObject("adodb.Recordset")
rstemp.maxrecords=3 '注意这里用了maxrecords属性
connectme="DSN=pubs;user id=sa;pwd=123"
rstemp.open "select * from titles", connectme,adopenstatic
' 显示表
howmanyfields=rstemp.fields.count -1
%>
<table border=1><tr>
<%
for i=0 to howmanyfields
%>
<td><b>
<%=rstemp(i).name %>
</b> </td>
<% next %>
</tr>
<%
do while not rstemp.eof
%>
<tr>
<%
for i = 0 to howmanyfields
%>
<td valign=top>
<% = rstemp.fields(i).value %>
</td>
<% next %>
</tr>
<%
rstemp.movenext
loop
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?