|
-
Mar 23rd, 2005, 05:27 AM
#1
Thread Starter
Junior Member
INSERT SQLString
Hi
Im trying to INSERT 152 rows in a table. To speed it up im trying to build a String with all the rows and then execute them all at once. Im using ADODB.Command but it looks like I can only insert one row at a time. Does anyone have an idea how to do this?
This is my code(Automation error):
szSQLString = ""
i = 0
Do While Not oRs2.EOF
szSQLString = szSQLString + "INSERT INTO...."
i = i + 1
If i = 152 Then
objCommand.CommandText = szSQLString
objCommand.Execute RecordsAffected:=lRecordsAffected, Options:=adCmdText Or adExecuteNoRecords
i = 0
szSQLString = ""
End If
oRs2.MoveNext
Loop
Best regards
/Bjso
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|