SQL code to insert multiple rows in ms-access table

后端 未结 8 1700
北荒
北荒 2020-12-15 14:01

I\'m trying to speed up my code and the bottleneck seems to be the individual insert statements to a Jet MDB from outside Access via ODBC. I need to insert 100 rows at a tim

8条回答
  •  无人及你
    2020-12-15 14:23

    Do you have to use SQL? If not, you'll probably get better performance if you insert rows using a recordset:

    Set rs=db.OpenRecordset("tblSimulation", dbOpenDynaset)
    With rs
        .AddNew
        !p=0
        !cfYear=2
        ' And so on
        .Update
    End With
    

提交回复
热议问题