我想批量增加数据,怎么写拉?
<% dim i,bookname(30),zuozhe(30),chubanshe(30),outtime(30),piece(30),leibie(30),jianjie(30)set rs=server.createobject("adodb.recordset")
sql="select * from allbook"
rs.open sql,conn,1,3
for i=0 to 29
bookname(i)=request("bookname"&i)
zuozhe(i)=request("zuozhe"&i)
chubanshe(i)=request("chubanshe"&i)
outtime(i)=request("outtime"&i)
piece(i)=request("piece"&i)
leibie(i)=request("leibie"&i)
jianjie(i)=request("jianjie"&i)
response.write bookname(i)
if bookname(i)="" and zuozhe(i)="" and chubanshe(i)="" and outtime(i)="" and piece(i)="" and leibie(i)="" and jianjie(i)="" Then exit for
next
response.write j
for i=0 to j
rs.addnew
rs("bookname")=bookname(i)
rs("zuozhe")=zuozhe(i)
rs("chubanshe")=chubanshe(i)
rs("outtime")=outtime(i)
rs("piece")=piece(i)
rs("leibie")=leibie(i)
rs("jianjie")=jianjie(i)
rs.update
next
response.write("本次共添加了")
response.write i
response.write("条数据")
response.write "<br><a href=insbook.asp>我还要添加</a>"
response.write "<br><a href=updatebook.asp>我要修改数据</a>"
%>