📄 445_3.asp
字号:
<%
response.buffer=true
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Cache-Control", "private"
%>
<html>
<head>
<title>RecordSet等的应用</title>
<meta http-equiv="pragma" content="no-cache">
</head>
<body bgcolor="#FFFFFF">
单击连接可以进行数据编辑:
<%
myDSN="DSN=pubs;user id=sa;pwd=123"
mySQL="select * from authors where AU_lname like 'D%' order by AU_ID"
IDfield="AU_ID"
scriptresponder="edit.asp"
set conntemp=server.createobject("adodb.connection")
conntemp.open myDSN
set rstemp=conntemp.execute(mySQL)
howmanyfields=rstemp.fields.count -1
%>
<table border="1">
<tr>
<td valign="top">---</td>
<% '在表头显示字段名
for i=0 to howmanyfields %>
<td><b>
<%=rstemp(i).name %>
</b> </td>
<% next %>
</tr>
<% ' 现在来得到所有记录
do while not rstemp.eof
%>
<tr><td valign="top">
<%
my_link=scriptresponder & "?which=" & rstemp(idfield)
%>
<a HREF="<%=my_link%>">Edit</a></td>
<%
for i = 0 to howmanyfields
%>
<td valign="top"><%=rstemp(i)%> </td>
<% next %>
</tr>
<%
rstemp.movenext
loop
rstemp.close
set rstemp=nothing
conntemp.close
set conntemp=nothing
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -