您的位置 >>> 星想互联 >>> 课堂教学 >>> 教学案例
ASP连接对象和记录集对象执行修改操作
点击数:2566  发布时间2013-04-02 15:53:41

<!--#include file="conn.asp" -->

<%
id=cint(request.querystring("id"))
if request.querystring("id")="" then
response.redirect("index.asp")
response.end
end if

title="tytryrtyrt"
hit=777
content="ttttttttttttttttttttttttttttt"

str="update news set title='"&title&"',hit="&hit&",content='"&content&"' where id="&id
conn.execute(str)
response.write "<script>alert('您的操作成功');window.location.reload('index.asp')</script>" %>

<%
'set rs= Server.CreateObject("adodb.recordset")
'rsstr="select * from news where id="&id
'rs.open rsstr,conn,1,3

'rs("title")=title
'rs("hit")=hit
'rs("content")=content
'rs("fdate")=now()
'rs.update
'response.write "<script>alert('您的修改操作成功');window.location.reload('index.asp')</script>"
 %>

来源:星想互联