[AccessD] Translation data length (cache used)

Stuart McLachlan stuart at lexacorp.com.pg
Sat Feb 21 21:47:53 CST 2009


>From Access 2003 - VBA Help:

Data Type Summary
String 
(variable-length) 10 bytes + string length 0 to approximately 2 billion  

and 

Differences in String Function Operations
The memory storage formats for text differ between Visual Basic for Applications (VBA) 
code and Access Basic code. (Access Basic was used in early versions of Microsoft 
Access.) Text is stored in ANSI format within Access Basic code and in Unicode format in 
Visual Basic.  

The Unicode format is used in Visual Basic to match the format of text within OLE, which is 
indirectly related to Visual Basic.  
...snip...
Storage format Storage pattern Description 
Unicode 41 00 42 00 43 00 42 30 44 30 46 30 Each character is stored as 2 bytes. 
ANSI 41 42 43 82 A0 82 A2 82 A4 ASCII characters are stored as 1 byte; double-byte 
characters are stored as 2 bytes. 

-- 
Stuart

On 21 Feb 2009 at 21:15, jwcolby wrote:

> I read somewhere long ago that VBA stored strings as 4 bytes that were a length, the data, and a 
> trailing Null.
> 
> That would be a 5 byte overhead.  Nowhere did it discuss unicode, though this was before the days 
> when unicode was so popular.
> 
> Can you point me to an explanation of what you are saying?  I Googled trying to find any such 
> definition and failed.
> 
> John W. Colby
> www.ColbyConsulting.com
> 
> 
> Stuart McLachlan wrote:
> > Len() measures in characters.
> > 
> > Access stores string data as a 10 byte header, followed by the character data in Unicode, 
> > using 2 bytes per character 
> > 
> > So 2500 strings with a total length of 140,000 character will take
> >  (2,500*10) + (140,000*2) = 305,000 bytes.
> >   
> > 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com





More information about the AccessD mailing list