日期:2014-05-17  浏览次数:20884 次

我要一次提交多条纪录到数据库的一个表里??怎么做!!
问题:现在我从上一个表单中得到用   如ID   (23,24,25,26,26,27),说明是用   where   id   in   ( "&id& ")       取得的六个参数.

现在我想把ID为23,24,25,26,26,27这个六组数据中的某5个字段中的数据一次性存入新表中,请问有什么办法.

谢谢!!请尽量详细些,我是个初学者!

------解决方案--------------------
'设置表单个数
inticp=29
For i=1 To inticp
If i> inticp Then Exit For
StrMess=StrMess&InSql(Request.Form( "F_ "&i& " "))& "┆ "
Next
'Response.Write StrMess

Dim arrayMess()
Redim arrayMess(inticp+1)
arrayList=split(StrMess, "┆ ")
For i=0 To Ubound(arrayList)
arrayMess(i) = arrayList(i)
'Response.Write i& ": "&arrayMess(i)& " <br> "
Next

Set Rs = Server.CreateObject( "Adodb.Recordset ")
Rs.Open "Select * From system_icp Where 1=2 ",Conn,1,3
Rs.Addnew
Rs(1)=Session( "adminid ")
Rs(2)=now()
For ii=3 To (inticp+3)
If ii> =(inticp+3) Then Exit For
Rs(ii)=arrayMess((cint(ii)-3))
Next
Rs.update
intid=Rs( "id ")
Rs.Close
------解决方案--------------------
这是sql语句
select 23 union all
select 24 union all
select 25 union all
select 26 union all
select 27



------解决方案--------------------
sql1= "select * from table1 where id in ( "&id& ") "
rs1.open......

do until rs1.eof
sql2=inser into table2(id....) value(rs1(id)....)
rs2.open.......
rs2.close
rs1.movenext
loop

不知楼主是否是这个意思,不过这样的效率很低.只是个思路.
------解决方案--------------------
参考语句 Insert into 表(字段) Select 字段 UNION ALL Select 字段 ......

SELECT 后面不一定要跟数据库内的数据

参看
http://feb-.blog.163.com/blog/static/16577892007019104026357/