Results 1 to 2 of 2
Thread: csv > access mdb
2009-05-24, 14:18 #1
- Join Date
- Jan 2004
- Thanked 0 Times in 0 Posts
Ho to transfer csv file stored in c:\temp\csv.txt into a table L0966 in c:\applicazioni\contabilita.mdb???
the csv file have headerrova01,prova02,prova03 is separated from ";"
the filelds in table arerova01,prova02,prova03
with ado please
i just have a coon opened
2009-05-24, 20:51 #2
- Join Date
- Aug 2001
- Evergreen, CO, USA
- Thanked 58 Times in 58 Posts
You have a number of options to consider in transfering a text file into a database table. One option is to simply link to the text file - the version of Access you are using may have some impact on how well that works. If you need it to be an Access table, then you could simply run an append query once you have linked to the table.
Another option would be to use the TransferText capability in VBA to reach out the the file and import it into an Access table which already exists. That may be the most straightforward approach.
It you really want to use ADO, which is the most difficult and doesn't buy you anything, you would have to either link to the table as in the first option, and then loop through each of the records, writing the corresponding record out using ADO, or you could do a READ from a text file, and parse each record, and then use ADO to build the table record by record.
My approach to all things database is to use the simplest technique - unless I'm doing something as a learning exercise, which I usually try to avoid, sometimes unsuccessfully.Wendell