Don't delete the destination table. Create it once, modify the field
datatypes as appropriate.
Then delete all the records.
Now use the GetExternalData wizard to import the CSV, but when you do this,
click on the "Advanced" button in the lower left corner of the wizard to open
the Import Specification Wizard. It will allow you to individually identify
the datatype for each field in your csv file, as well as indicating which
fields to skip, if you want to do this.
Once you have done this, click the "SaveAs" button, and name the import
specification. From then on, when you use the TransferText method on a file
with this particular format, use this ImportSpecification.
--
HTH
Dale
email address is invalid
Please reply to newsgroup only.
"(E-Mail Removed)" wrote:
> Hello
>
> The code below imports a csv-file into a table.
> For the field F18 I don't get what I want.
> In the csv-file 'F18' is of a 'general' format. I don'g get the data
> correctly, it has been transformed into a 'time format'. Even if I add
> the ALTER TABLE ALTER COLUMN statement to change the data into numbers
> doesn't help. Now I have some blancs where there even shouldn't be
> one.
>
> Can somebody help?
>
> DoCmd.DeleteObject acTable, "TBL_Import_TPXP_Radi_College_Newcsvfile"
> DoCmd.TransferText acImportDelim, ,
> "TBL_Import_TPXP_Radi_College_Newcsvfile", "X:\TRANSIT60\AFTP
> \USPB1815\RADICOL\NEW.CSV", False, ""
>
> DoCmd.RunSQL "ALTER TABLE [TBL_Import_TPXP_Radi_College_Newcsvfile]
> ALTER COLUMN [F18] number"
>
|