473,399 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

compact/repairing at runtime

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
2 2871
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ColinWard | last post by:
I don'tunderstand why when you use Compact and Repair, only the front end is compacted? I understand about repairing, because the front end stores the forms, queries etc. but the backend is where...
1
by: Andy | last post by:
Hi ! I have a simple application. 2 tables, nothing fancy. Split front-end Back-end. Multiple versions of Access use this database. Acess2K and Access3K. When I try to Compact & Repair, the...
3
by: marc | last post by:
Hi all, I have a database that accesses another db through a dao connection and does a lot of deleting of OLE Object fields and such that have been obviously bloating my db. Everything is...
2
by: Ron | last post by:
Hi All, Using WinXP pro/Access 2000. I have a database that's been used for about 5 months. Transferred lots of data from a dos based program, then the users have been using it for that 5...
9
by: Ron | last post by:
New discovery. If I take a perfectly good database, and "compact/repair" on it with Access 2000 (seems to be at multiple sites--I've tried it with my system here, at another office on an...
2
by: Wally | last post by:
Hi there, One table is corrupted. I found compacting is the cause or triggers the process. I have the solution to repair the wrong records but after each compact the same table is corrupted again...
3
by: Bizmark | last post by:
Access2003, Windows XP Pro OEM user OS, Windows Sever 2000 server OS. Not-so-recently I inherited 3 Access DB's from another company merging with our own. Our own system works off of SQL...
1
by: Neil.Young | last post by:
Hi, I have written a WinForm app using VS 2008. The app uses LINQ to SQL for a SQL Server Compact Edition database. The Setup has only one requirement (by default): .net 3.5 runtime. Now I...
0
by: ARC | last post by:
Hello all, Due to some users experiencing severe front end bloating (Normal compacted front end .accdr is 27MB's, FE can bloat to 80-90+Mb's in a day), I want to enable the "Compact on Close"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.