Results 1 to 3 of 3
  1. #1
    Claude is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    2

    Unhappy Import in Access (2003)

    Hello all,

    I want to import a txt.file in Access. If I do it manually, everything is OK. But if I want to do it by VBA : DoCmd.TransferText acImportDelim, "ImportSpecificationBasicFile", "BasicFile", GetImportFile(), True
    where BasicFile the name is of the file where to import
    GetImportFile() the name is of the file to import
    then I receive at some places in the table strange characters :for exemple : Pavé d'Ath / Rue Félix Bovie / Rosières

    It seems that there is a problem with the special french characters : é è ê, à ç ù
    Could it be a prbl with the codepage? and so how can I resolve it and include in this VBA sentence?


    Thanks in advance.

  2. #2
    ps3-31 is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2009
    Posts
    1

    Import in Access (2003)

    Hello,

    You want to import a .txt file, yet I think you are passing a function or method instead of the pathway and name of the .txt file. The VBA code takes a .txt file (and it's location) as a parameter and doesn't take the function/method.

    Here's an example of the format . . .
    DoCmd.TransferText acImportDelim, "Import Specification Name", "tableName as destination table", "pathway, including file name.txt extension", True, ""

    More specifically . . .

    WHERE "Import Specification Name" is import specs
    WHERE "tableName" is the destination table for the data

    WHERE "\\vs-access1\MADatabase\FinancialAidDB\ImportFiles\FALL _DETAILS.txt", is the pathway on my server where the .txt file resides, with the name of the .txt file (FALL_DETAILS.txt)

    Then comes True or False if your column names are to be included
    Then comes double quotes ““ to exclude HTML table name

    I import from VBA code daily and it works fine.
    Hope this helps.

  3. #3
    Claude is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2009
    Posts
    2

    hello ps3

    thanks for your help. So far I got it, but I think I have to add some information in the vba script, more specially concerning the 'CodePage'. But I don't know how and what...
    expression.TransferText(TransferType, SpecificationName, TableName, FileName, HasFieldNames, HTMLTableName, CodePage)

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

Similar Threads

  1. Import Excel Worksheets into Access 2003
    By KramerJ in forum Programming
    Replies: 0
    Last Post: 03-18-2009, 04:11 PM
  2. converting from Access 2003 to Access 2007
    By LawrenceLau in forum Access
    Replies: 6
    Last Post: 11-20-2008, 03:53 PM
  3. Replies: 1
    Last Post: 09-06-2006, 11:48 AM
  4. access 2003 automation issue
    By BevA in forum Programming
    Replies: 2
    Last Post: 05-01-2006, 08:37 AM
  5. Help! Newbie needs help with Access 2003!!!
    By infernojericho in forum Access
    Replies: 0
    Last Post: 12-03-2005, 08:11 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