trimming of space characters on file import

G

Guest

Hello,

I am trying to import a file into access where some of my records values are
a space. The space character is correctly displayed in the text file as " "
but Access trim the value on import and set the field to null in the
destination table. The import is carried out using DoCmd.Transfertext.

How can I prevent Access from trimming start and end spaces in the data
imported from a flat file.

Regards,

Yann
 
J

John Nurick

Hi Yann,

AFAIK Jet automatically trims trailing spaces on import and in most
update operations, and the only way to get them into a table is to use
recordset operations to set the field values.

The first thing I'd try is to create the table before importing the
data, setting the AllowZeroLength property of the field in question.
With luck that will import the spaces as zero-length strings, enabling
them to be distinguished from nulls.
 

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