I need to have a button on an ASP.NET page that would trigger a data copy from one table in Oracle to an Access DB. There are about 25’000 rows. This process would be triggered abot 2-3x per day and optimization (speed) is the key requirement.
I tried making a DataReader with the Oracle the data and then, iterate through it, each time doing an INSERT into Access with ExecuteNonQuery(). It takes more than 5 mins using this method.
This is not my area of expertise at all and I’d appreciate some hints (or even a working code sample) as to what I should do.
Few precisions: for some reason (I know it’s deprecated), I have to use System.Data.OracleClient. The table in Oracle and the one in Access have the same field names.
You can run a query against an MS Access connection that includes an in-line connection to Oracle. I do not have a copy of Oracle at the moment, but it would look something like:
( http://www.connectionstrings.com/oracle#microsoft-odbc-for-oracle )
You can get an accurate connection string by connecting the relevant table to your copy of MS Access using the External Data wizards and then checking the connect property of the Tabledef. Which leads to another possibility, which is to run the query against the Access connection using a linked Oracle table. This will just be a straight MS Access query.
Finally, you should be able to output to a CSV from Oracle and import into MS Access, this should be quicker than row by row, because pretty nearly everything is.