Newbie. How to loop through importing text files and compactingquestions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • aconti74@gmail.com

    Newbie. How to loop through importing text files and compactingquestions

    Hello I am new to vba programming/coding. I am writing a program that
    goes through a directory of text files and imports them into the
    database. The problem is eventually the database gets to big and
    needs to be compacted. I know how to compact on exit but how do you
    do it in a loop using vba? My old program in basic did it because it
    was external to access. Any ideas?


    1.import text file
    2.loop - check size
    2a. compact database if need and continue importing text files.
    2b. continue importing text file
  • Chris O'C via AccessMonster.com

    #2
    Re: Newbie. How to loop through importing text files and compactingquest ions

    If you're using Access 2K or newer to compact the current database, use this
    code:



    If you're using Access 97, you can't compact the current database via code,
    but there are alternatives. See this page:



    If you're using Access 2007, I don't have a canned answer for that one yet.

    Chris
    Microsoft MVP


    aconti74@gmail. com wrote:
    >Hello I am new to vba programming/coding. I am writing a program that
    >goes through a directory of text files and imports them into the
    >database. The problem is eventually the database gets to big and
    >needs to be compacted. I know how to compact on exit but how do you
    >do it in a loop using vba? My old program in basic did it because it
    >was external to access. Any ideas?
    >
    >1.import text file
    >2.loop - check size
    2a. compact database if need and continue importing text files.
    2b. continue importing text file
    --
    Message posted via AccessMonster.c om


    Comment

    Working...