I have a bit of Access experience but am new to threading. I'm using C#.Net to load millions of records into an Access DB. I spun off a thread as to give the user the option to cancel the operation and resume later.
Actually I'm using OLEDB to populate the DB. However, I'm not aware of a way to use OLEDB to compact it. So I am trying to use DAO to compact it after every 100,000 records. But DAO doesn't seem to work on my thread. It seems to work fine, however, when run normally, that is, from the main thread.
I was also trying to use DAO to append a property value to the DB. This too failed on the thread - but I was able to move this code to the main thread.
However, I don't see how I can move compaction to the main thread since I probably need to compact after every 100,000 records or so.
Doe anyone have any suggestions?
Actually I'm using OLEDB to populate the DB. However, I'm not aware of a way to use OLEDB to compact it. So I am trying to use DAO to compact it after every 100,000 records. But DAO doesn't seem to work on my thread. It seems to work fine, however, when run normally, that is, from the main thread.
I was also trying to use DAO to append a property value to the DB. This too failed on the thread - but I was able to move this code to the main thread.
However, I don't see how I can move compaction to the main thread since I probably need to compact after every 100,000 records or so.
Doe anyone have any suggestions?