日期:2014-05-17 浏览次数:21053 次
str = "2,23,24,55," str = left(str,len(str)-1) sql = "insert into users (num,time) select " sql = sql & Replace(str,",",", getdate() union all select ") & ",getdate()" ConnMain.execute(sql)
------解决方案--------------------
用批处理方式,一次递交
<%
ss = "2,23,24,55,"
ss = Replace(ss, " ", "")
aryReturn = Split(ss,",")
sql = "SELECT [num], [time] FROM [users] WHERE 1=0"
Set rs = CreateObject("ADODB.Recordset")
rs.CursorLocation = 3
rs.Open sql, ConnMain, 1, 4
For i = 0 To UBound(aryReturn)
If aryReturn(i)<>"" Then
rs.AddNew
rs("num").Value = aryReturn(i)
rs("time").Value = Now()
End If
Next
rs.UpdateBatch
rs.Close
Set rs = Nothing
ConnMain.Close
Set ConnMain = Nothing
%>