如何在表中间用ADO插入记

作者:袖梨 2022-06-30
【 在 lucky (高山) 的大作中提到: 】
下面是用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("记录添加完毕!!!!")

相关文章

精彩推荐

一聚教程网

Copyright © 2010-2022

111cn.net All Rights Reserved