Import delimited without specification name

ebaldo

Baldo
Local time
Today, 20:51
Joined
Oct 25, 2007
Messages
1
Hy,
I need to import a CSV file with a ";" delimited and name field in the first row.
I need to control the name of the field that are in the first row.

If I import with

DoCmd.TransferText acImportDelim, , "tempLISTA", sCSVFile, True

the file:
----
RAGSOC1;RAGSOC2;INDIRIZZO;CAP;CITTA;PROV;PAESE;
PEDRAZZI SPA;;VIA ROMA, 24;00100;ROMA;RM;ITALIA;
----

I didn't obtain a table with the field right because the import without specification name is not drived by ";"
I obtain a table with a first field called RAGSOC1;RAGSOC2;INDIRIZZO;CAP;CITTA;PROV;PAESE;CAMPO1;CAMPO2;CAM

Is possible to set the ";" by default for the acImportDelim without a specification name ?

thank you
and bye
Enrico
 
You could bring the file in and then in the next line change the first field name to what you want using:
ALTER TABLE table_name
RENAME COLUMN old_name to new_name;
 
Hi,
I have a similar problem!
I'm trying to import Text Files which are Tab Delimited. The problem is that the field names may be in different orders between Text Files, and also there may be more fields in some files Text Files than others.
Is there any way of creating a very generic import spec whereby, i can just specify Tab Delimited, First Row Contains Field Names, and No Primary Key, and nothing else?

Many thanks in advance
 

Users who are viewing this thread

Back
Top Bottom