473,804 Members | 3,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2893
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*********@gm ail.comwrote in message
news:11******** **************@ i39g2000hsf.goo glegroups.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.orgZE RO_SPAMwrote in
message news:L_******** *************** *******@adelphi a.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*********@gm ail.comwrote in message
news:11******** **************@ i39g2000hsf.goo glegroups.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
1498
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 the data is stored and surely that file will need to be compacted more than the front end? Colin
1
320
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 progress bar stops in the middle and does not budge.
3
1958
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 running great except I need to know how to compact and repair the database that I'm accessing with recordsets and such through code when I'm all through deleting, but not the one I have open that sets up the connections. As always thanks in advance...
2
2783
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 months. About 180000 records in one of the main files (maybe 25000 new since the dos conversion). Been having some speed issues crop up along the way (much faster to do same reports when I first transferred the data than now, with the new 25000...
9
3993
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 entirely different network), it damages the file somehow. The user's machine that did the compact/repair can see the file fine. But any networked user can't get in. I can double click on a good database file from any user (over the network) and it...
2
2039
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 at the same place. After repairing the table by cutting rows and appending data from outside (sql from coldfusion or from Excel), user may appends row(s) in this table. Until compacting everything is fine with those new records. After compacting,...
3
2210
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 server, but mainting these databases is critical to keeping the business running. 1 database in particular has been causing problems. Along the course we have had a few problems with random records corrupting (new and old) and Values within fields...
1
2197
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 got a notice from a colleague of mine, reporting problems with running my app on Windows XP, SP 2, .net 3.5 runtime installed. This machine doesn't have any binaries of the Visual Studio environment installed, just plain ..net 3.5.
0
2840
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" option on the front end, and distribute in a runtime installation. I do have my share of update / append queries, and I've always suspected that they are the main culprit, but it's hard to say. One strategy I tried was to move the frequently used...
0
10318
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10069
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7608
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2975
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.