Solved

"Temporary Object" Leak

Posted on 1998-03-04
2
216 Views
Last Modified: 2008-03-06
This question deals not with specific coding but with Access '97's handling of "Temporary Objects"
Recently my file size on my database has been escalating significantly (from 4MB 2 weeks ago to 84MB today) but that is not all data... After "Compacting" the database the file size returned to 1.4MB.

Q: Why is Access hoarding 82+MB of "Temporary Objects" - how are they getting there and how do I force Access to clean up after itself?

Thx in advance
0
Comment
Question by:Terran
2 Comments
 
LVL 2

Accepted Solution

by:
BigJ earned 100 total points
Comment Utility
Access creates the temporary objects as you design objects which need to be compiled. There is no way to stop this except to compact now and again.

The only way to get around this is to automatically compact the database every so often. As Cekman said to another question, you can not use the compactdatabase in code to compact the database that is open. However, there is an article that discusses how to create a separate database that will compact any number of databases for you at a specified time. It is KB article Q158937 on the microsoft support site - www.microsoft.com/support

It describes how to create a separate database that can be opened that will automatically compact whatever databases you choose, and also some of the limitations for using code to compact.

0
 
LVL 3

Expert Comment

by:guillems
Comment Utility
Make a procedure to compact the database

The code do that this is:

' Parameters aName is the name of the database to compact.

Function CompactMDB(aName As String) As Integer
  Dim ws As Workspace, db As Database, nname As String

  nname = Left(aName, Len(aName) - 3) & "NEW"
  DBEngine.CompactDatabase aName, nname
  Kill aName
  Name nname As aName
  CompactMDB = True

End Function

Put the next code in a click's event button.

I hope this help you
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now