Results 1 to 6 of 6
  1. #1
    exhumed is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    6

    1)shema.ini does not work, 2)import in 1 column

    Hello everybody!
    It is my first post so nice to meet you


    I have got the following problems:
    - I try to import txt file to Access table in two ways:

    1)
    Sub nn()
    DoCmd.TransferText acImportDelim, "schema.txt", "testtable3", "D:\dd\test.txt", False, ""
    End Sub

    schema:
    [test.txt]
    Format=Delimited(

    the structure of the file which I try to import:

    text1;text2;text3;text4
    zzz;ddd;sss;aaa;
    www;kkk;lll;ppp;

    Result: access window shows me that the specification of file shema.txt does not exist

    2)
    Sub nn()
    DoCmd.TransferText acImportDelim, "", "testtable3", "D:\dd\test.txt", False, ""
    End Sub

    Result: I have one column and two rows and header in testtable3 but i want to have header, two rows and four columns

    thx for help

  2. #2
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,065
    Change DoCmd.TransferText acImportDelim, "", "testtable3", "D:\dd\test.txt", False, ""
    To
    DoCmd.TransferText acImportDelim, "", "testtable3", "D:\dd\test.txt", True, ""

  3. #3
    exhumed is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    6
    thx!
    I have changed "False" into "True" (to have the header of course) but it still does not work

  4. #4
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,065
    My error, didn't look at your sample data close enough. (thats what I get for rushing) Since your separating your fields with the semi-Colon you have to use an import specification. You should create the specification with the import wizard in Access and then save it. Use the name you saved it under to do the import in code. I believe there is a way to create the specification in VBA prior to doing the import but I've never done it that way. Perhaps someone with more knowledge than I can help you.

  5. #5
    exhumed is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    6
    thx a lot! I am still fighting

  6. #6
    exhumed is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    6

    Thumbs up

    Got it! Thank you very much for your suggestions about creating the specification with the import wizard in Access. I did it this way and my import works!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. import specific column from excel to access
    By eshtul in forum Import/Export Data
    Replies: 6
    Last Post: 11-11-2011, 09:54 AM
  2. Live Import from my work DB to a purchased Invoice DB
    By AndrewsPanda in forum Import/Export Data
    Replies: 4
    Last Post: 10-05-2011, 09:00 AM
  3. Delete first row and Column for excel import
    By kazman101 in forum Import/Export Data
    Replies: 1
    Last Post: 07-18-2011, 06:53 AM
  4. csv import second row contains column headings
    By dr_patso in forum Import/Export Data
    Replies: 1
    Last Post: 07-16-2011, 03:56 PM
  5. Import Excel into access does not work
    By hawg1 in forum Import/Export Data
    Replies: 1
    Last Post: 05-28-2010, 12:05 PM

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