Access and space it takes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I haven't found information concerning usage of hard drive space in Access
anywhere. When I for example create a table which has a text field in it
(255) and I put only ten characters into it, does Access reserve space for 10
characters or for 255? How about if I have a field that has double as its
data type, and I don't put anything to that field?

Is there a possibility for dynamic memory usage in VBA?

(I'm only interested in this matter, it doesn't really concern my
programming at the moment..)

-Beginner-
 
Access uses only the diskspace it needs for the data. It does not use 255
bytes of disk space just because a Text field is defined as 255 characters
in size.

The actual amount of space used depends on lots of factors, including your
code page and the field's Unicode Compression is turned on.

A Memo field uses just enough for the address to where the data is actually
stored (perhaps 10 bytes), plus any data. A Double uses 8 bytes, regardless
of how many digits are stored in it. In addition to the field data, there is
some overhead for the table itself and for each field.

The total number of actual bytes in a record must not exceed 4k. Otherwise
Access won't be able to fit it into the page buffer.

In VBA, memory is handled for you. You don't need to set memory aside in the
way you do using languages such as C. You should declare your variables, and
you should clean up after yourself (closing what you opened, setting objects
to nothing.) You can also erase arrays if you need to release memory in the
middle of a procedure.
 
Back
Top