Is this a one-off operation? If it is, I would just open Access and import the data directly.........you'll save yourself a lot of time!
If this is a data import application you will need to run routinely, I would push for some format other than CSV or Excel, or otherwise access your data from some low-level file access operation. I've been shot in the foot one too many times with CSV/Excel and ADO for data import. XML is much better for this sort of thing, if you can get it!
the conversion would be a routine operaton.my boss forwards a CSV file to me for processing from time to time.i never asked him why its in that format, but i assume it's what's most comfortable for him.converting it to XML is a great idea, though...help on that one...?
hanne:
thanks, bro...you have proved to be a most useful creature...
i'll tinker with that conversion code for a while, and we'll see how that goes..
i modified the code a bit, then tried it.it works fine for a CSV file that has a maximum of 85045 records.anything above that and it generates an error like so:
"input array is longer than the number of columns in this table"
I see you've found one of the first gotchas in working with Excel/CSV and ADO. Like I said before, I've found it can be a long, frustrating road and have actually used the File System Object instead of ADO with CSV. I think the FSO is still around in VB.Net.
You asked about getting your data in XML. There is a utility in Excel XP and beyond to generate XML from a spreadsheet. I've heard the results can be disappointing in the way of incomprehensible tags and getting XML documents that are not "well formed," so keep that in the back of your mind.
Sorry I usually generate my XML right out of the SQL Server database so I don't know how much help I'll be, but I did Google "Excel to XML" and found a couple of good leads. You might want to look into these (the first two look very promising):
thanks again, Linda, but i found a way to convert a large CSV file into a dataset...now i am thinking of doing away with the Access table completely, and use an excel file instead...
at the moment, i already know how to query a sheet, and some particular columns (except if i wish to query columns A and D only, for example).
if i can do that, life would be a lot easier for me...
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.