1

I use ADO components in C++ Builder and I need to add about 200 000 records to my MS Access database. If I add those records one by one it takes a lot of time so I wanted to use threads. Each thread would create a TADOTable, connect to a database and insert it's own rows. But, when running the application it is even slower then using only one thread!

So, how to do it? I need to add many records to my Access database but want to avoid one-by-one insertion. A code would be useful.

Thank you.

manlio
  • 18,345
  • 14
  • 76
  • 126
Tracer
  • 2,544
  • 2
  • 23
  • 58
  • Although C# related, this may be helpful [writing-large-number-of-records-bulk-insert-to-access-in-net-c](http://stackoverflow.com/questions/7070011/writing-large-number-of-records-bulk-insert-to-access-in-net-c) – Jorik Oct 08 '12 at 09:12
  • 1
    possible duplicate of [Bulk Insert into access database from c#?](http://stackoverflow.com/questions/4646791/bulk-insert-into-access-database-from-c) – Tony Hopkinson Oct 08 '12 at 09:12

1 Answers1

-1

First of all multithreading will not increase the speed of inserts. It will slow it down because of context switching and stuff. What you need is the way to have bulk inserts , that is sending multiple rows in a single transaction

Try searching for bulk inserts in acesss tables. There is a lot of information there.

Adnan Akbar
  • 718
  • 6
  • 16