Results 1 to 3 of 3

Thread: TXT files

  1. #1
    Join Date
    Dec 2002
    Location
    Phoenix, AZ
    Posts
    122

    Cool Unanswered: TXT files

    I need to import a file, into Access, that gets downloaded from our main database everyday. The file is named "motor_accounts.asc". Will Access allow me to import this (.asc) file? I know I can do it manually but is it possible to import it using VB? I have used the TRANSFERTEXT methods in the past but I don't see and TRANSFERASC method. I would like to automate this importing process because it needs to be done everyday. I would rather push a button that imports the file instead of having to convert the file to a TXT file and then import it. Can anyone help?

  2. #2
    Join Date
    Mar 2002
    Location
    Sacramento, CA
    Posts
    120

    Try it!

    Import it manually the first time. Create the specs.

    Then you can use a macro or code using the TransferText method.

    Using Macro:
    TransferType......... Whatever it is
    Specification Name..... Your Specs name
    Table Name........... Whatever it is
    File Name..... C:\MyFolder\motor_accounts.asc

    The key is to create the Import Spec manually first.

    Michael

  3. #3
    Join Date
    Nov 2002
    Location
    San Francisco
    Posts
    251
    docmd.TransferText can easily do it. You can setup your import SPECIFICATION and then use it in DoCmd.TransferText if you have some special import (fixed length).

    there is lot of info in Access Help for DoCmd.TransferText


    if you have the file on the same place, isn't it easier to LINK the file and then use the CREATE TABLE or APPEND query and get the data from the linked table?



    jiri

Posting Permissions

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