How to use LongBinary Fields for Binary data 
Author Message
 How to use LongBinary Fields for Binary data

I hoped to use the dbLongBinary data fields to store UserDefined Types or
whole arrays of data in a single record. This statement by Microsoft
encouraged me.

"Use a Memo field for text, and put binary data only in Long Binary fields.
Doing otherwise will cause undesirable results."

So when I tried using AppendChunk to add an integer variable's data to the
field

rstTest!F1.appendChunk intI

I was surprised that I receive a datatype mismatch error. THEN I read the
AppendChunk and GetChunk methods info more carefully and noticed that the
variable read and written is a String. I had assumed it would be a variant
type.

Now of course I can use Str or Format to convert a single variable easily,
but this gets a bit more complicated for single or doubles (loss of
precision) and for Arrays and UDTs.

So, how do you put non-text into a longBinary field, keeping the data in
binary format? For an example, how would you store data in the following
datatype into dblongbinary fields?

Type APoint
    X As Double
    Y As Double
End Type

or even better

Type APoints
    Data(10) As APoint
End Type

TIA

Bob



Tue, 19 Mar 2002 03:00:00 GMT  
 How to use LongBinary Fields for Binary data
Bob,
I believe you must use the ADO data types that are mapped to the database.
(so I don't think you will be able to put a UserDefinedType in)
http://www.able-consulting.com/ADODataTypeEnum.htm

--

Thanks,
Carl Prothman, MVP, CCP
http://www.able-consulting.com

ADO FAQ: http://www.able-consulting.com/ado_faq.htm
RDS FAQ: http://www.able-consulting.com/rds_faq.htm


Quote:
> I hoped to use the dbLongBinary data fields to store UserDefined Types or
> whole arrays of data in a single record. This statement by Microsoft
> encouraged me.

> "Use a Memo field for text, and put binary data only in Long Binary
fields.
> Doing otherwise will cause undesirable results."

> So when I tried using AppendChunk to add an integer variable's data to the
> field

> rstTest!F1.appendChunk intI

> I was surprised that I receive a datatype mismatch error. THEN I read the
> AppendChunk and GetChunk methods info more carefully and noticed that the
> variable read and written is a String. I had assumed it would be a variant
> type.

> Now of course I can use Str or Format to convert a single variable easily,
> but this gets a bit more complicated for single or doubles (loss of
> precision) and for Arrays and UDTs.

> So, how do you put non-text into a longBinary field, keeping the data in
> binary format? For an example, how would you store data in the following
> datatype into dblongbinary fields?

> Type APoint
>     X As Double
>     Y As Double
> End Type

> or even better

> Type APoints
>     Data(10) As APoint
> End Type

> TIA

> Bob



Tue, 19 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. help: doublesize of data in longbinary field

2. DAO longBinary Fields (Graphics)

3. Printing a graphic from LongBinary field

4. Longbinary Fields Double Expected Size

5. LongBinary Field - Confused!!

6. Adding objects to Access OLE/LongBinary fields

7. Win 98 BUG - huge problem for LongBinary fields !!!

8. Binary Data In OLE Object Fields

9. Data Type Conversion Error with Long Binary Field -PLEASE HELP

10. SQL Searching For Text in Memo Fields with Binary Data Included

11. Saving DB binary field data into file

12. How to read binary fields without data control

 

 
Powered by phpBB® Forum Software