不等长数值的批量写入数据库问题?
上图那样的情况
<%
UserName=request.form("UserName")
HardWareNo=request.form("HardWareNo")
MapCode=request.form("MapCode")
str=split(UserName,vbnewline)
for i=0 to ubound(str)
conn.execute("insert into MapCommision(UserName) values('"str(i)&"')")
next
str=split(HardWareNo,vbnewline)
for i=0 to ubound(str)
conn.execute("insert into MapCommision(HardWareNo) values('"&str(i)&"')")
next
str=split(MapCode,vbnewline)
for i=0 to ubound(str)
conn.execute("insert into MapCommision(MapCode) values('"&str(i)&"')")
Response.Write("<script language='javascript'>alert('恭喜您,授权信息添加成功!');window.location.href='Info_Addbb.asp';</script>")
next
conn.update
%>
这样写会产生
id HardWareNo MapCode username
1 aaaaaaaa
2 aaaaaaaa
3 aaaaaaaa
4 vvvvvvvvvvv
5 vvvvvvvvvvv
6 vvvvvvvvvvv
7 vvvvvvvvvvv
8 dsfsfsdfsdf
9 fsdfdfsdfsdf
[此贴子已经被作者于2006-9-1 17:14:13编辑过]