Access

  • Thread starter Thread starter Wayne Gibson
  • Start date Start date
W

Wayne Gibson

Hi,
Was wondering if anybody could help.

I'm looking to add a lots of records to an access database, but it looks
like I'm going to have to insert them one at a time!!!
Looks like I'm going to have to do this for each new record..

Insert into Database(<fields>) VALUES(<values>)

Was wondering if there was anything similar to the MySQL Implementation
where I can add several new rows in one SQL command.

Many thanks

Wayne
 
You could use: DataAdapter.FillSchema() to create a mapped DataTable that
looks like the original, but has no data in it. You could then populate
that table with your new data and then just use: DataAdapter.Update().
 
Wayne,

You can use Scotts solution, however be aware, they will forever inserted
one in a time.

A dataadapter uses the same commands as you do.

Just a little addition.

Cor
 
Thanks for replying..

But surely this is just doing multi insert intos?

The MySQL version of insert into works like this...

INSERT INTO table (col1, col2, col3)
VALUES
('val1','val2','val3'),
('val1','val2','val3'),
('val1','val2','val3');

I know that when I converted from executing individual insert into to this
insert into on a MySQL it was a great improvement..

The problem is that I have about 55000 inserts to do and I wanted a quick
way to do it..
Any other ideas?

Thanks

Wayne
 
Wayne Gibson said:
Hi,
Was wondering if anybody could help.

I'm looking to add a lots of records to an access database, but it looks
like I'm going to have to insert them one at a time!!!
Looks like I'm going to have to do this for each new record..

Insert into Database(<fields>) VALUES(<values>)

Was wondering if there was anything similar to the MySQL Implementation
where I can add several new rows in one SQL command.

You still need to do it one record a time, but you could use an Access
Stored Proc as shown in the article at
http://www.devcity.net/Articles/18/msaccess_sp.aspx

The only real advantage would be in not having to send the <fields> list
over each time.
 
Back
Top