[AccessD] Table size

Max Wanadoo max.wanadoo at gmail.com
Wed Sep 30 17:45:25 CDT 2009


This is true, but it is a starter. I now realise that with memo fields, etc
I need to actually count the contents using FieldSize but according to MS,
there are still some gotcha's, viz:-

It is doable though, depends on the level of accuracy you want.

"The FieldSize property and the VBA Len() or LenB() functions may return
different values as the length of the same string. Strings are stored in a
Microsoft Jet database in multi-byte character set (MBCS) form, but exposed
through VBA in Unicode format. As a result, the Len() function will always
return the number of characters, LenB will always return the number of
characters X 2 (Unicode uses two bytes for each character), but FieldSize
will return some value in between if the string has any MBCS characters. For
example, given a string consisting of three normal characters and two MBCS
characters, Len() will return 5, LenB() will return 10, and FieldSize will
return 7, the sum of 1 for each normal character and 2 for each MBCS
character."

NB. It will give  working figure for what I would ever need it for. YMMV.

Havent a clue what JC wants it for.


Max


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: 30 September 2009 23:36
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Table size

Good idea, but it won't give you realistic figures.

That will give you an exagerated size for text fields - ie 255 characters as
opposed to the 
actual size of the stored strings plus the 4 bytes for the size info - and
what about memo 
fields?

Plus much of the space used by a table may be the storage of its indexes,
not just its data.


-- 
Stuart
rs.com




More information about the AccessD mailing list