当前位置:编程学习 > asp >>

ASP 修改数据代码~~求高手!!

<!--#include file=conn.asp-->
<%
if request("ok")<>"" then
id=request("id")
name1=trim(request("name1"))
age=trim(request("age"))
addr=trim(request("addr"))
tel=trim(request("tel"))
set rs=server.CreateObject("adodb.recordset")
sql="select * from StudentInfo where id="&request.QueryString("id")
rs.open sql,conn,2,3
rs("name")=name1
rs("age")=age
rs("addr")=addr
rs("tel")=tel
rs.update
rs.close
set rs=nothing
response.write("<script language='javascript'>alert('修改成功');</script>")
end if
set rs=server.CreateObject("adodb.recordset")
sql="select * from StudentInfo where id="&request("id")
rs.open sql,conn,1,1
rs=close
set rs=nothing
conn=close
set conn=nothing
%>
补充:运行时 总提示EOF为真  找不到这条记录可能是被删除..
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,