如何在表中间用ADO插入记
来源:岁月联盟
时间:2004-09-20
下面是用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("记录添加完毕!!!!")
上一篇:向浏览器传送脚本
下一篇:用ASP编缉数据库记录











