importing delimited ascii file with zero-length strings

V

VMI

When I import a delimited text file with zero-length string, Access
automatically converts it to a null value. When I create the table (I use a
create query from dotNet), how can I create a table field so that the
zero-length value between these two delimitors (ie. ",John,Doe,,3232") is
not converted to a null value? I need to display the data in my dotNet
application and the fields with zero-length values are shown as [null].

thanks.
 
D

Dirk Goldgar

VMI said:
When I import a delimited text file with zero-length string, Access
automatically converts it to a null value. When I create the table
(I use a create query from dotNet), how can I create a table field so
that the zero-length value between these two delimitors (ie.
",John,Doe,,3232") is not converted to a null value? I need to
display the data in my dotNet application and the fields with
zero-length values are shown as [null].

Can you change the creation of the text file so that the string values
are quoted? For example,

"John","Doe","",3232

would probably be imported the way you want.

A retroactive solution would be to update the table after importing,
changing Null values to zero-length strings in those fields which might
contain them. You could do this by executing one or more update
queries, or by opening a recordset on the table and looping through its
records.
 

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