Table sizes?

[nateobot]

Registered User.
Local time
Today, 14:53
Joined
Jul 15, 2002
Messages
64
Does anyone know how I can find out the breakdown of how much diskspace my tables/queries/forms are taking up?

Thanks
-Nathan
 
Well, it isn't easy - but you can come close for the tables. I have no clue as to the sizes of other structures.

First, understand this funny thing about text fields. No matter how you declare them, they are variable length. Whether they are of type Text or type Memo. When you declare a Text field, Access stores a pointer. When you populate a text field, Access stores the data somewhere in the container file that is the .MDB and just updates the pointer to reference the stored text string. This is true for both Text fields and Memo fields.

OK, the way to do this is to write a query for each table.

Each field in this query should be the length of the field's storage unit. For some of the fields, this will be a constant. So, for example, if a field is of type LONG then its length is 4. If a field is of type DOUBLE then its length is 8. Yes/No fields are 1. But for the text fields, you don't put in a constant. Put in 8 + Len([Field]) The "8 +" part takes the string control pointer into account.

OK so far? Now add one more column to the query that is the sum of all the other fields. (If you wanted to short-cut matters, leave out the individual fields that are constant length and just add them to this total as a single number.) Now run a totals query on THAT query. That is the size of that table, not counting the TableDef overhead.

Do that for each table. You now know the space taken up by your tables.

To know how much space the other things take up, you probably need to do something either illegal or very difficult. The illegal item is to reverse-engineer the database layout. (Read your EULA if you don't think it is illegal.) The difficult thing is to find a Web site that will tell you the sizing rules. But I haven't looked for one lately.
 

Users who are viewing this thread

Back
Top Bottom