Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2004

    Unanswered: import csv files

    my database crashed the other and o could not get it reparied so i have to rebild itand put the data back.

    all the data is xported to a csv file with an name "table20090724.csv" numbers beeing the date i want to be able to import a lot of tables at the one time with out having to pick each file.

    is this possable

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 15
    Here is a solution:
    Function BulkImport(Path As String)
        Dim CSVFile As String
        If Right(Path, 1) <> "\" Then Path = Path & "\"
        CSVFile = Dir(Path & "*.csv")
        Do While Len(CSVFile)
            DoCmd.TransferText acImportDelim, , , Path & CSVFile
            CSVFile = Dir
    End Function
    This supposes that all the csv files are in a directory given by Path. Search in help for the meaning of the different options you can use with the TransferText method.

    Have a nice day!

  3. #3
    Join Date
    Aug 2004
    i have a backup of my data base so i dont need them all want to be able to set dates i want to import


  4. #4
    Join Date
    Aug 2004
    the path is stored in a table called "palms" in a field called "backup"

  5. #5
    Join Date
    Nov 2007
    Adelaide, South Australia
    Have a look at looping and the DIR command.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!

    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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