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

compact/repairing at runtime

P: n/a
hello, i have a question about compactin/repairing a database at
runtime.

i have code that will do this, but when it runs i get the error "You
can't compact the open database while running a macro or visual basic
code"

this is very confusing to me, because i got it to work on one database
without the error, and i did the exact same thing on the second
database and I get the error. no matter what I do I cannot seem to get
this to work.

any ideas?

Jan 10 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi.
i have code that will do this, but when it runs i get the error "You
can't compact the open database while running a macro or visual basic
code"

this is very confusing to me, because i got it to work on one database
without the error, and i did the exact same thing on the second
database and I get the error.
This means that, in the database with the error, you have code or a macro
running. Close everything in the database first, and then compact it with
your code if you're running Access 2000 or later. If you're running Access
97, your code won't work if it's in the same database that you need to
compact.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
<gi*********@gmail.comwrote in message
news:11**********************@i39g2000hsf.googlegr oups.com...
hello, i have a question about compactin/repairing a database at
runtime.

i have code that will do this, but when it runs i get the error "You
can't compact the open database while running a macro or visual basic
code"

this is very confusing to me, because i got it to work on one database
without the error, and i did the exact same thing on the second
database and I get the error. no matter what I do I cannot seem to get
this to work.

any ideas?

Jan 10 '07 #2

P: n/a
Hi.

If you're running Access 97, then please see the following Web page for
alternatives:

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

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"'69 Camaro" <Fo**************************@Spameater.orgZERO_SP AMwrote in
message news:L_******************************@adelphia.com ...
Hi.
>i have code that will do this, but when it runs i get the error "You
can't compact the open database while running a macro or visual basic
code"

this is very confusing to me, because i got it to work on one database
without the error, and i did the exact same thing on the second
database and I get the error.

This means that, in the database with the error, you have code or a macro
running. Close everything in the database first, and then compact it with
your code if you're running Access 2000 or later. If you're running
Access 97, your code won't work if it's in the same database that you need
to compact.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
<gi*********@gmail.comwrote in message
news:11**********************@i39g2000hsf.googlegr oups.com...
>hello, i have a question about compactin/repairing a database at
runtime.

i have code that will do this, but when it runs i get the error "You
can't compact the open database while running a macro or visual basic
code"

this is very confusing to me, because i got it to work on one database
without the error, and i did the exact same thing on the second
database and I get the error. no matter what I do I cannot seem to get
this to work.

any ideas?


Jan 10 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.