467,076 Members | 878 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,076 developers. It's quick & easy.

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
Jul 23 '08 #1
  • viewed: 2914
Share:
1 Reply
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.

Similar topics

2 posts views Thread by Awah Teh | last post: by
11 posts views Thread by Grim Reaper | last post: by
2 posts views Thread by Regnab | last post: by
29 posts views Thread by Natan | last post: by
5 posts views Thread by hharriel@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.