Solved

"Temporary Object" Leak

Posted on 1998-03-04
2
224 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
ID: 1970025
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
ID: 1970026
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

785 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