ISAM Importing CSV file containing "empty" fields

Posted on 2003-03-28
Medium Priority
Last Modified: 2009-02-13
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!!
Question by:situnayake
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 18

Expert Comment

ID: 8224781
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.

Author Comment

ID: 8224814
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
LVL 18

Accepted Solution

1William earned 375 total points
ID: 8224872
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:

Unless you do something klugey (link to the csv, 'read' the number of space, append them after update....

Author Comment

ID: 8224932
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 :)
LVL 18

Expert Comment

ID: 8224945
Thanks for the points.  Who knows, as you re-do the process, you may find a solution to your woes.  best of Luck.

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question