Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    texttransfer (Access 2003)

    I have a simple text file that I want to import into an Access table called tblTesting. Below is the same data. I am wondering how I can use the TextTransfer method to import the data.

    col 1-3 customer ID
    col 4-5 invoice $ amt
    col 6-13 invoice date

    1234520070212
    1232420070422
    2245320060102

    Thanks

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: texttransfer (Access 2003)

    The transfer text method contains a parameter for the Input Specifications. In there you specify that the text file is fixed width and can specify the fields and what columns they occupy.

    Another way to do it is to import into a 1 field table, then use a query to read thru that table ane append to another table specifying fields using the mid command.

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: texttransfer (Access 2003)

    Hi Pat, if that is the case, based on my sample data, how would I be setting up the spec? Can you provide me the spec parameters based on my sample data?

    Thanks

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: texttransfer (Access 2003)

    The best way to create an import specification is to start importing the text file interactively, through File | Get External Data | Import...
    Work your way through the wizard.
    At the end, instead of clicking Finish, click Advanced...
    In the dialog that appears, click Save As... to save the specification. Write down or memorize the name you give.
    The specification will be stored in the database, so it will be available to anyone using the database.
    You can actually finish the import or not - that doesn't matter.
    Use the name you gave to the import specification in the SpecificationName argument of DoCmd.TransferText.

Posting Permissions

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