设为首页
加入收藏
站内地图
旧版入口
当前位置:首页 > 站长学院 > 网络编程 > ASP

如何在表中间用ADO插入记

作者:佚名 出处:网络转载 时间:11-19 点击:

内容载入中...
【 在 lucky (<marquee>高山) 的大作中提到: 】
下面是用ADO在表中插入记录的一个例子请参考
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DSN=data;UID=sa"
Set RS =Server.CreateObject("ADODB.Recordset")
RS.Open "your_table", Conn,1,3,2 //*打开您的表
RS.AddNew //*增加一条记录
RS.Fields.Item("field1")=Request.Form("form_field1")
RS.Fields.Item("field2")=Request.Form("form_field2")
RS.Fields.Item("field3")=Request.Form("form_field3")
...
RS.Fields.Item("fieldn")=Request.Form("dform_fieldn")
RS.Update
RS.Close
Set RS=Nothing
Conn.Close
Set Conn=Nothing
Response.Write("记录添加完毕!!!!")
收藏本文:
】【打印页面】【推荐给朋友】【关闭窗口

站长学院

推荐信息