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

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

<%
title="aaaaaaaaa"
hit=45
content="aaaaaaaaaaaaaaa"

'str="insert into news(title,hit,content) values('"&title&"',"&hit&",'"&content&"')"
'conn.execute(str)
'response.write "<script>alert('您的添加操作成功');window.location.reload('index.asp')</script>" %>

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

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

来源:星想互联