[AccessD] Field data type Binary and creation of specific field data type

Gustav Brock Gustav at cactus.dk
Sun Jun 4 07:33:23 CDT 2006


Hi Stuart

Unfortunately not. Looks like Access knows this is Unicode and counts the length of the binary data to 255 chars.
Perhaps the flag bit usage could do ...

/gustav

>>> stuart at lexacorp.com.pg 04-06-2006 13:17 >>>
On 4 Jun 2006 at 12:10, Gustav Brock wrote:

> Did you know that a Binary field type is available with a length of 510
> bytes? 
...
> 
> You might get the idea that it will hold strings of length beyond 255 chars
> but no, it will not. They will be truncated, 255 is still the maximum. It

Strings are store as Unicode and use two bytes each
510 bytes = 255 x 2 byte characters.

> mostly looks like a fixed length "Tiny OLE Object" as it seems to hold a
> fixed length byte array. So what's the purpose if this field type? Or how to
> use it in a way not offered by other data types? 

Looks as though it would be useful to store a user-defined type in a single 
field.

I'd guess that you could use StrConv(strMyString,vbFromUnicode ) and 
StrConv(strMyString,vbUnicode )  with a terminating Null  to store up to 
509 character strings in the field and still have ithem searchable/sortable 
- although it will probably only sort in ANSI order (case sensitive - all 
caps sorting before all lower case).

You could also use it to store up to 4080 bit flags per record. :-)

-- 
Stuart




More information about the AccessD mailing list