''保存编辑
Public sub saveedit()
set rs=server.createobject("adodb.recordset")
sql="select * from user where id =" & userid
rs.open sql,conn,1,3
rs("name")=username
rs("content")=usercontent
rs.update
rs.close
Response.write "更新记录成功!"
end sub
''删除记录
public sub deluser()
set rs=server.createobject("adodb.recordset")
sql="delete from user where id="& userid
rs.open sql,conn,1,1
set rs=nothing
Response.write "删除记录成功!"
end sub
''挑战分页显示~~!!
public sub list(n)
dim page
page=request("page")
PageSize = n
dim rs,strSQL,news
strSQL ="SELECT * FROM user ORDER BY id DESC"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSQL,Conn,3,3
rs.PageSize = PageSize
totalfilm=rs.recordcount
pgnum=rs.Pagecount
if page="" or clng(page)<1 then page=1
if clng(page) > pgnum then page=pgnum
if pgnum>0 then rs.AbsolutePage=page
if rs.eof then
response.write "<font color=''#003366'' class=''3dfont''>没有记录!</font>"
else
count=0
do while not (rs.eof or rs.bof) and count<rs.PageSize
with response
.write "<table><tr><td> "
.write rs("id")&" "
.write "<a href=show.asp?id="&rs("id")&">"
.write rs("name")
.write "</a> "
.write "内容: "&rs("content")
.write "</td></tr></table>"
end with
rs.movenext
count=count+1
loop
end if
with response
.write "<table><tr><td> 共<b>"
.write rs.pagecount
.write "</b>页"
for i=1 to rs.pagecount
.write " <a href=list.asp?page="&i&">"
.write i
.write "</a>"
next
rs.close
set rs=nothing
.write "</td></tr></table>"
end with
end sub
''类退出后,作清理工作
Private Sub class_terminate()
If IsObject(Conn) Then Conn.Close:Set Conn = Nothing
End Sub
End Class
%>
(以上程序在winxpsp2+netbox通过)