By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,456 Members | 1,529 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,456 IT Pros & Developers. It's quick & easy.

Newbie. How to loop through importing text files and compactingquestions

P: n/a
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
Jul 23 '08 #1
Share this Question
Share on Google+
1 Reply


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

http://www.mvps.org/access/general/gen0041.htm

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

http://www.mvps.org/access/modules/mdl0030.htm

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

Chris
Microsoft MVP
ac******@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.com
http://www.accessmonster.com/Uwe/For...ccess/200807/1

Jul 24 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.