asp连接数据库代码实例(4)
发布时间:2021-06-06
发布时间:2021-06-06
asp 连接数据库代码实例
response.write(\"<a href=?page=\"&page+1&\" title=\'下一页\'>下一页</a> \")
else
response.write(\"下一页 \")
end if
if page<>n then
response.write(\"<a href=?page=\"&n&\" title=\'尾页\'>尾页</a> \") else
response.write(\"尾页 \")
end if
response.write(\" 当前页:\"&page&\"/\"&n&\"\") %>
转到:<select name=\"select\" onChange=\'javascript:window.open(this.options[this.selectedIndex].value,\"_top\")\'>
<%for p=1 to rs.pagecount%>
<option value=\"?page=<%=p%>\" <% if page=p then response.write \"selected\" end if%>>第<%=p%>页</option>
<%next%>
----------------------------------------------
4。更新纪录,删除纪录,删除所有记录
<%
if request(\"action\")=\"manage\" then
call manage()
end if
if request(\"action\")=\"edit\" then
id=request(\"id\")
set rs=server.createobject(\"adodb.recordset\")
sql=\"select * from biao where id=\"&id&\"\"
rs.open sql,conn,1,1
call edit()
end if
if request(\"action\")=\"del\" then
conn.execute(\"delete * from biao where id=\"&request(\"id\")&\"\")
conn.close
response.write\"<script language=\'javascript\'>alert(\'删除成功!\');location.href(\'?action=manage\');</script>\"
end if
if request(\"action\")=\"delall\" then
conn.execute(\"delete * from biao\")