When importing a CSV can I removed the Data Type setting

A

AccessHar

I am using the following import for a CSV file

DoCmd.TransferText acImportDelim, , _
"TBL_All_CSV_RECORDS", Path & Reports_Dirs,
True

It works fine, but some fields are given a Number data type automatically
when the Table in Created by runnuing the Code above, I would prefer if all
fields were defaulted to TEXT, is there a way to do this in VB code
 
K

Klatuu

Use an import/export spec.
Start the export manually (File, Get External Data, Export) When you get to
the wizard, click on advanced. Then you can identifiy the field names, data
types, etc for exporting. Once it is complete, click Save As and give it a
name. Then when you do your export programmatically, use that name in the
specification argument of the TransferText method. See VBA Help if you need
specifics on the syntax.
 
A

AccessHar

I am using Access 2007, and I want to import not export, the thousands of CSV
files into one table, I get runtime errors because the code to import and
make the table assigns specific Data types to the Fields, these data types
conflict when the rows are read in and contain whole text or numbers, i have
to use the code import now the menus and the utility will be used by finance
and must be automatic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top