473,406 Members | 2,404 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,406 software developers and data experts.

Cannot compact

I have been compacting my backend databases on a daily basis for
years. Today the compact operation hangs up both internally or when
run from a shortcut using the /Compact switch. Older copies will
compact. This one db had a couple of forms and queries which I
delteted, just leaving me with tables but that did not help.

I am aware than you cannot compact an open database but as long as
no table is being accessed you can do it on the tools menu.

I start the compact, it seems to run and then hangs up part way
through with the status bar about halfway full. I "X" out and then
see that db1.mdb has been created but not deleted.

Any ideas?

Hank Reed

Nov 13 '05 #1
7 1986


Hank wrote:
I have been compacting my backend databases on a daily basis for
years. Today the compact operation hangs up both internally or when
run from a shortcut using the /Compact switch. Older copies will
compact. This one db had a couple of forms and queries which I
delteted, just leaving me with tables but that did not help.

I am aware than you cannot compact an open database but as long as
no table is being accessed you can do it on the tools menu.

I start the compact, it seems to run and then hangs up part way
through with the status bar about halfway full. I "X" out and then
see that db1.mdb has been created but not deleted.


Possibly corrupt? Is the uncompacted backend usable? I had a similar
problem a while ago and I just added a code module, added a dummy
function e.g.

Public Sub DoNowt

DoEvents

End Sub

I then compiled, and this seemed to sort things out.

I am aware that this might seem a rather haphazard approach, but when
backends go pear-shaped, sometimes you have to resort to desperate
measures. You could also try to decompile (msaccess /decompile <your
database name>) but this should only be attempted with a recent safe
backup. You could also try importing the db objects into a new
database.

Good luck

Edward

Nov 13 '05 #2
Good advice. I would also consider trying the Microsoft utility
"JetComp.exe". You can find it on their web sites. It's a little more
robust than the internal compact and repair in Access.

If you import the tables one at a time into a new back end data file,
try compacting after each one. If you find a table you can't import or
that makes the compact choke, try to eyeball it and see if there is a
corrupt record you can manually delete... I once created a new empty
table and either ran queries or cut and pasted all the records before
or after my corrupt record...

Good luck. If worse comes to worse, you can always try one of the
commercial data recovery services.

Jim

Nov 13 '05 #3
Check out db1.mdb - does it have everything you need?
Can you just rename it and use it?

"Hank" <ha********@aol.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I have been compacting my backend databases on a daily basis for
years. Today the compact operation hangs up both internally or when
run from a shortcut using the /Compact switch. Older copies will
compact. This one db had a couple of forms and queries which I
delteted, just leaving me with tables but that did not help.

I am aware than you cannot compact an open database but as long as
no table is being accessed you can do it on the tools menu.

I start the compact, it seems to run and then hangs up part way
through with the status bar about halfway full. I "X" out and then
see that db1.mdb has been created but not deleted.

Any ideas?

Hank Reed

Nov 13 '05 #4
Hello,
Thanks for all the good ideas. I tried JetComp and it aborted
everytime. I took Jim's advice about importing the tables into a new
database. You can actually import them all at once with
File\GetExternalData\Import. I selected all tables and started the
import. The import aborted on a table named [Audit Trail]. When I
eliminated that table (Don't worry guys, I'm using a backup copy) the
database would compact OK.
Then I started reading [Audit Table] (saving the record number in
another table) until it broke. The bad record was the next one after
13900. When I tried to view the table, its was OK until I hit the
corrupted record, and then aborted. So I wrote a query to delete the
offending record.
Everything is now OK.
Thanks again,
Hank Reed

Nov 13 '05 #5
"Hank" <ha********@aol.com> wrote in
news:11*********************@o13g2000cwo.googlegro ups.com:
Thanks for all the good ideas. I tried JetComp and it
aborted
everytime. I took Jim's advice about importing the tables into a
new database. You can actually import them all at once with
File\GetExternalData\Import. I selected all tables and started
the import. The import aborted on a table named [Audit Trail].
When I eliminated that table (Don't worry guys, I'm using a backup
copy) the database would compact OK.
Then I started reading [Audit Table] (saving the record
number in
another table) until it broke. The bad record was the next one
after 13900. When I tried to view the table, its was OK until I
hit the corrupted record, and then aborted. So I wrote a query to
delete the offending record.


Is there a memo field in that table?

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #6
Hello David,

No, there is no memo field. What would be the significance of that?

Thanks,
Hank Reed

Nov 13 '05 #7
"Hank" <ha********@aol.com> wrote in
news:11**********************@g14g2000cwa.googlegr oups.com:
No, there is no memo field. What would be the significance
of that?


That's a very common cause of exactly the kind of error you
encountered, because it's easy for the memo pointers to be
corrupted(memos are not stored in the same data pages as the actual
records; only a pointer to the correct data page is stored with the
record; this is natural, since memo fields can be huge or small or
anything in between). And usually the only way to correct it is to
get the non-memo data out of the record, delete it and recreate it.
The memo data itself is almost always lost.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: James Franklin | last post by:
Hi, I have a number of databases in A2K, written on different machines with different installations of Office. I have found that compacting a database while it is open regularly fails, seemingly...
13
by: Larry L | last post by:
Access is noted for bloating a database when you add and delete records frequently. I have always had mine set to compact on close, and that works great. Now after everyone's advice I split my...
1
by: ColinWard | last post by:
Hi there. I just tried to create an MDE from an Access XP App but it crashed out and gave me the "Microsoft Access has encountered a problem and needs to close" message. Has anyone seen this? I...
2
by: Greg Strong | last post by:
Hello All, I've written code in a test database with test data. Everything seems to be working except compact database in VB code per http://www.mvps.org/access/general/gen0041.htm. The reason I...
6
by: MLH | last post by:
I just used Tools / Database Utilities / Compact Database in Access 97 for the first time. Unlike Access 2.0, it does not ask me to furnish a filename for it to compact into. It just launched...
1
by: Sivaprasad | last post by:
Hi All, I am developing an app in Compact framework. When i run the app i am getting the error "Cannot connect to the remote Server". I put the same code in regular VB.Net it works fine.But not...
5
by: bob | last post by:
Hi Using 2003 - targeting the compact framework (c#), but would like to do most development using the full.net (manually leaving out stuff not in the compact framework). Q. Trying to find a...
6
by: antonyliu2002 | last post by:
I was able to view table content easily before, but after I reinstalled everything, I cannot find the option to view table content in MS SQL Server Express. I can define table with no problem. ...
3
by: Bruce | last post by:
I have a number of Access 2000 format databases on a Windows 2003 server. For some reason I can no longer compact these databases directly on the server using Access 2003. Access 2000 seems to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.