Microsoft Access - Issue with importing data from .CSV

Asked By Mahima Chandani on 22-Apr-13 07:16 AM
Hi friends,
I have a .ADP file through which I have to upload data from a .CSV file into a temp table.
the problem that I am facing is that certain columns of this .CSV file may have both Numeric and Alphanumeric fields..

So assuming for the 1st time if the data in Column A is Numeric the temp table is created with datatype (Int) but I want this datatype to be (Nvarchar) everytime by default..  as my main table into which this data will be appended is having Column A as (Nvarchar)

As of now my data which has Alphanumeric values in Column A are getting uploaded as NULL which is incorrect.

Please help me..
I tried a workaround of formatting this column as "Text" but .Csv does not save formatting and I am unable to upload use the command of .Transfertext using .XLS file..

Please help..

Robbe Morris replied to Mahima Chandani on 22-Apr-13 09:44 AM
Assuming you must let Access create the temp table for you (versus you managing this yourself in code), you could simply read the csv file, insert a line as the first record containing what you want, then process the bulk load.  At the end, remove the first record you imported.