trimming of space characters on file import

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
Back
Top