Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

ISAM Importing CSV file containing "empty" fields

I am trying to use the JET ISAM text driver to import a CSV file into an ADO recordset. The problem is that some of the field values (all quoted) contain nothing but spaces, I would like to preserve these spaces within the imported recordset but can't prevent them from being converted to nulls.
I have set up the necessary Schema.INI file but can't find any options that would prevent this behaviour.

Just as an aside how would you store nothing but spaces in an Access 2K text field!!
0
situnayake
Asked:
situnayake
  • 3
  • 2
1 Solution
 
1WilliamCommented:
One possible solution would be to run an update on the table after importing.  You can append a record with "     ".  Access apparently is reading your csv for these fields as null.  I have imported data from various db where there was padding on the data.  Access included this padding.
0
 
situnayakeAuthor Commented:
ADO seems to strip off any trailing spaces.
The prblem is that I may need the exact contents of the field rerad in. If someone wants to import a field containing 8 spaces for example I would need to ensure this was read in "as is" and not as an empty string
0
 
1WilliamCommented:
I was afraid of that!  Saddly, I have always wanted to get rid of the spaces and therfore have never attempted to solve the issue of retaining them.  These MS Kb discuss the issue:
http://support.microsoft.com/default.aspx?scid=kb;en-us;182354
and:
http://support.microsoft.com/default.aspx?scid=kb;en-us;182355


Unless you do something klugey (link to the csv, 'read' the number of space, append them after update....
0
 
situnayakeAuthor Commented:
Cheers,
I may well have to re-write the import routine to just manually read the text file and create the ADO recordset "on the fly" I only did it using the ISAM stuff so I could manipulate field names etc!

think you may as well have the points :)
0
 
1WilliamCommented:
Thanks for the points.  Who knows, as you re-do the process, you may find a solution to your woes.  best of Luck.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now