giannis said:
I have made an application with a database with one table.
I need to know when is necessary to run (with the code), the
CompactDatabase Method for this database.
What is the approximately normal analogy between the records
and the size of a .mdb database with one only table?
You could probably figure this out by complicated calculations involving
the sizes and types of fields in the table and the size of the database
when the table is empty. I wouldn't do it that way, though. I'd just
take measurements of the compacted size when the table is empty and when
the table contains various numbers of records ranging from small to
medium to large. You could write a VBA routine easily enough to fill
the table with a specified number of records with text and memo field
values set to an average size. With a few measurements like that, you
should be able to come up with a good rule of thumb for determining how
big the database should be, in terms of its file size, for a given
number of records. Comparing the actual size to this computed size
should be enough to tell you whether the database would benefit a lot
from compacting. For example, you might want to compact when the
database is twice the computed size.