What is the fastest way to load a text file to an access Database?
I have Text file that contains data separated with a comma ,
.
How do I load this to access in the fastest way?
The Text file contains 20开发者_开发问答0,000 rows.
I work with C#.
Access is quite happy to import CSV files, it can be done through an SQL statement.
SELECT ID,Field1 INTO NewTable
FROM [Text;HDR=YES;FMT=Delimited;IMEX=2;DATABASE=C:\Docs\].Some.CSV
See: Speed up insert mdb
well if you have 2 hard drive's try placing the text file on one hard drive and the access database on one hard drive, you could then try to use 2 threads one for reading and one for writing..
the fastest and hackiest way I know would be to import the data to excel and then cut and paste it into the table in Access. If you need something programatically then I am sure a quick search could find a way to read a CSV file in C#. From there you just need to open a C# data source and plow the data in.
Can you be more specific about your problem...
精彩评论