打印本文 打印本文  关闭窗口 关闭窗口
用数组实现数据记录的批量录入方法
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005/9/10 14:19:56
)=request.form(mydata)
next
next
%>

<%
rem 输出表单输入的值
for i= 1 to 10
for j= 1 to 6

response.write data(i,j)

next
response.write"<br>"
next

'response.end
%>

<%
dim conn,rs
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & _
             Server.MapPath("hbedu.mdb")


for i= 1 to 10
rem 循环批量入库

Set rs=SERVER.CreateObject("ADODB.Recordset")
rs.Open "hbedu",conn,1,3
  rs.AddNew
  rs("beizhu")=data(i,6)
  rs("filename")=data(i,5)
  rs("cpcontent")=data(i,4)
  rs("papertaocount")=data(i,3)
  rs("dytaocount")=data(i,2)
  rs("provinceid")=data(i,1)
  rs.Update
rs.close
set rs=nothing

response.write"ok<br>"
next
%>
演示:http://www.zwtd.com/1/yanek/n/needdj2.asp

上一页  [1] [2] 



打印本文 打印本文  关闭窗口 关闭窗口