Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2011
    Posts
    82

    Unanswered: Importing Text File Problem

    Hello

    I have some code written in VBA which is as follows:

    DoCmd.TransferText acImportDelim,
    "IP_DiagnosticActivityMTD Import Specification", "IP_DiagnosticActivityMTD", "G:\Information\BIT\Diagnostic Activity v2.txt"

    This imports a text file into my database


    I have recently added a new colummn to my text file and I cannot get the new column to show when I run this code

    How do I get the new column to show in the imported table and stay there....Any ideas?

    Thanks for your help

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Did you update the Import Specification "IP_DiagnosticActivityMTD Import Specification" when you added the column? You have to do that also, and don't forget to save it.

    Sam

  3. #3
    Join Date
    Dec 2011
    Posts
    82
    Hello

    Thank you for your response

    No, I did not save the import specification, and I am unsure on how to do so

    Could you kindly tell me how?

    Many Thanks
    Helen

  4. #4
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    I use Access 2003, so my response is based on that version.

    In the database window, click on the File menu, select Get External Data, and select Import. In the dialog box, navigate to the file IP_DiagnosticActivityMTD. (So far, you're just repeating the same steps you did when you created the Import Specification in the first place.)

    In the Import Text Wizard, click on the bottom left command button labeled "Advanced..." If the spec called "IP_DiagnosticActivityMTD Import Specification" isn't displayed, click on the command button labeled "Specs" along the right margin of the wizard form. A list of available specs will appear in a list box; select the correct one, and the current structure will display. Insert the new column in the correct place and save the spec (using the "Save As" command button) with the same name. Click "OK" to exit the wizard, and click "Finish" to exit the dialog box. Now try your routine again. It should import correctly.

    Good luck,
    Sam

  5. #5
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    995
    Provided Answers: 2
    Import specifications are held in a couple of hidden tables, MSysIMEXSpecs and MSysIMEXColumns. You can write SQL queries to view and amend these tables, but be careful when doing so.
    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
  •