Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    995
    Provided Answers: 2

    Unanswered: "Invalid Argument" while trying to use Import Text Wizard

    Hi all

    I'm trying to create some import specifications so that I can automate an import process. There are four text files that I need to import, each to its own table.

    The first two are really small, and I have the required specs for them. The other two are somewhat larger (in terms of file size and column counts), and both of them failed the import. I followed the steps in the wizard to select the file, set up delimiting characters and destination table. Then I brought up the "Advanced" form to save the spec. On clicking "Finish", the second two both gave me the "Invalid argument" non-message and didn't import.

    I've performed a Google search, and the one hit for {"Access Import Text Wizard", "Invalid Argument"} was this post in this forum! Alas, this does not answer my question.

    Any ideas? I'm using Access 2000, SP3.
    10% of magic is knowing something that no-one else does. The rest is misdirection.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Could you supply a sample of the files you try to import (without sensitive data of course) and precisions on how you set up the import wizard (screenshots perhaps)?
    Have a nice day!

  3. #3
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    995
    Provided Answers: 2
    I've uploaded an archive containing the database file stripped of confidential stuff and one of the text files that won't import normally. If you can do anything with it, thank you!

    However, I have found a workaround - opening the files and using the Input# function to take each data point into a variable, and then using the variables to write to a recordset. This is a little slow and clunky, though.
    Attached Files Attached Files
    10% of magic is knowing something that no-one else does. The rest is misdirection.

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    The workaround you found is the one I was going to suggest.

    The problems seems to be related to the format of numeric values. In my case, the problem was that the International Settings of Windows here (Belgium) use the comma (,) not the dot (.) as the decimal separator. Everything works perfectly if you import all the fields as Text.

    This could be a solution: import everything as Text then run an update query to perform the necessary transformation and insert the data in the table where they belong. It will be faster than reading one line at a time with the Input or Line input functions.
    Have a nice day!

  5. #5
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    995
    Provided Answers: 2
    Great minds think alike!

    TBH, I think I'll take the performance hit. This db is just for my use - it will monitor the numbers and usage of SKUs enrolled on the SOP system.

    I'll bear your suggestion in mind if it ends up being circulated further, though. Thanks!
    10% of magic is knowing something that no-one else does. The rest is misdirection.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •