A
AC
Hi
I am importing some csv data into Access.
the data is a mixture of text and numerical, ie each field may contain
some text data or some numerical data.
If i import using the wizard it correctly imports into a new table
with each field text.
However i need to automate this so i have some vba to import the
data. When using DoCmd.Transfer text it imports into a new table but
sets each field as a number type, so I lose the text data (i also get
a myData_ImportErrors table created).
Maybe use a spec? .... BUT....
Here is the rub:
I dont think I can create and use a spec because the size of this
file, ie the number of fields, is not static, it may be different
every time.
I have tried a spec and then changed the file size and it just drops
the new/additional fields which were not present when making the spec.
(eg make a spec with 10 fields, then when import a 12 field data file
it just drops the 2 additional fields).
Ideas?
Can i create and use a simple spec on the fly which just says "make
all fields strings"?
if so, can someone point me to how to do it.
i could pre-parse the file to figure out how many columns are in it,
is it easy to make a spec with that additional info?
I am sort of hoping to avoid having to make a table on the fly, ie
just use TransferText to do all the work for me.
Thanks in advance
A
I am importing some csv data into Access.
the data is a mixture of text and numerical, ie each field may contain
some text data or some numerical data.
If i import using the wizard it correctly imports into a new table
with each field text.
However i need to automate this so i have some vba to import the
data. When using DoCmd.Transfer text it imports into a new table but
sets each field as a number type, so I lose the text data (i also get
a myData_ImportErrors table created).
Maybe use a spec? .... BUT....
Here is the rub:
I dont think I can create and use a spec because the size of this
file, ie the number of fields, is not static, it may be different
every time.
I have tried a spec and then changed the file size and it just drops
the new/additional fields which were not present when making the spec.
(eg make a spec with 10 fields, then when import a 12 field data file
it just drops the 2 additional fields).
Ideas?
Can i create and use a simple spec on the fly which just says "make
all fields strings"?
if so, can someone point me to how to do it.
i could pre-parse the file to figure out how many columns are in it,
is it easy to make a spec with that additional info?
I am sort of hoping to avoid having to make a table on the fly, ie
just use TransferText to do all the work for me.
Thanks in advance
A