multiple inserts

  • Thread starter Thread starter jeff
  • Start date Start date
J

jeff

i want to perform multiple inserts by value into an access table in 1
operation. i know how to do this with multiple, separate queries... i don't
want to do that because it is making my save operation take 5 minutes for a
3mb database, which is ridiculous. here is what i've tried and none of
these work.

this one gives an error that the sql statement should have ended after the
first ;:
insert into tbl values (1,2,3);insert into tbl values (4,5,6);

this one tells me i was missing a ; after (1,2,3):
insert into tbl values (1,2,3),(4,5,6);

this one tells me i'm missing a ; after the first insert statement:
insert into tbl values (1,2,3)
insert into tbl values (4,5,6);

is there any way to do this in access? the above techniques work with other
db formats, but doesn't do squat in access.

thanks for any help.
 
You would have to loop round each Insert statement and call it individually
as there is no concept of a session as in SQL. I would also consider
re-writing it with a few transactions as this will improve the overall
performance.
 
transactions? i've heard of those, but i'm fairly ignorant when it comes to
databases. i am actually making these sql calls from within another
program, but the end database is access.
 
Back
Top