Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    mitch_pearce79 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Dec 2012
    Location
    Perth
    Posts
    15
    I copied the original .csv data from post #8 and saved it in notepad as a .csv file
    I then created a new database and used the Import Text Wizard (exactly as ssanfu) suggested, and it imported perfectly.


    Why bother delimiting the file in excel when you can import it directly from the .csv? Seems you're adding an extra step by using excel.

  2. #17
    mitch_pearce79 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Dec 2012
    Location
    Perth
    Posts
    15
    Post #15 - "The first information set..."

    When using the Text Import Wizard it's important to complete the information in the right order. I think (in fact I'm almost certain) your issue is that you checked 'First Row Contains Field Names' before you tried delimiting by pipe '|'.

    As ssanfu indicated you must select, in order:
    Delimited
    Other (backspace |)
    First Row contains header names

    Then it'll be smooth sailing for ya! - I've done it twice now and worked perfectly both times...

  3. #18
    mrmmickle1's Avatar
    mrmmickle1 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Location
    North Carolina
    Posts
    78
    mitch_pearce79,

    So I believe that you and ssanfu are correct.... I must have been doing this in the wrong order.....However, now that the import preview appears perfectly I receive the original error message

    index or primary key cannot contain null value

    As previously mentioned. I have set no primary key..... There is also no Index set for any field..... See Picture:

    https://www.dropbox.com/s/t4para5ck1...Error.PNG?dl=0

    Any tips on how to resolve this error? It makes no sense....

    Are there any other reasons known to raise this error? Besides what the msgbox states....

  4. #19
    thebigthing313 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    119
    Late to the conversation, but here's my 2 cents.

    Maybe the error Access is reporting is wrong. In the past, I've had troubles with imports (can't remember what exactly the errors were, it could've been the index/primary key issue), and it was usually fixed by confirming that each line in the CSV file was valid. People so far are testing with the sample data you posted, but if the CSV file has much more rows, then maybe one of those rows can be throwing off the import process. You might be better off throwing in the towel with figuring out what is causing the issue with a direct import of the CSV, and just living with the extra step of converting to xlsx and importing that, which you said works without a hitch.

    If you're up to it, you can always write VBA code to validate (according to your own rules) the CSV file prior to import. I myself am a firm believer in writing my own procedures to handle things like this if you aren't getting enough information from Access as to why the native methods won't work.

  5. #20
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    RE: your post #15.

    When I imported the test data using"The first test was with the quote delimited text in a file I named TextImport.csv.", after I selected the Text Delimiter, all of the quotes disappeared. I've tried this 4 times - every time the quotes in the data were removed (during the import process). I would have to try using the actual text (csv) file.


    Otherwise, you would have to write a lot of VBA to do the import.

    One of my import routines to import a CSV file is about 60 letter size pages long. That is just the import routine, does not include any other code in that form module. LOTs of error checking before adding/modifying data in 8 tables.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 01-14-2013, 11:50 PM
  2. Replies: 5
    Last Post: 11-05-2012, 04:07 PM
  3. Replies: 7
    Last Post: 04-23-2012, 01:25 PM
  4. Replies: 3
    Last Post: 10-11-2011, 01:43 PM
  5. Replies: 9
    Last Post: 07-14-2011, 07:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums