retrieving binary data

S

Steve

I'm attempting to store images as OLE binary types. I'm pretty confident
that I have the storage down, but retrieval is alluding me. I can't find
articles on the subject. I'm using ADO.net 2.0. Is there a way to
determine the size of the data or do I need to store a separate size value?
Is there a way to access the data without looping through and copy to an
array index by index?

Thanks for any suggestions,
Steve
 
T

Tom Ellison

Dear Steve:

There are different formats for the storage of binary images. Probably
there is, for each format, a function to retrieve various kinds of
statistics about the images. Not unlikely, the information you want is
stored in some kind of header within the image.

You do not say which image format you're using, nor do I know the specific
formats for these. But, generally, some function could be written, or may
already exist, to do this. You should look especially at the available
documentation for these files, and expecially documentation for libraries
that perform this. Not unlikely you could call this function from VBA, and
incorporate a VBA function to do this in your query.

Does anyone in this forum know of appropriate NGs for this? I haven't yet
met the MVPs for Paint.

Tom Ellison
 
S

Steve

Hi Tom,

Thanks for getting back to me. I wasn't as clear as I could have been in my
original post. I can get the size of the image file. I was trying to
determine the size of the data in a cell in a DataTable when retreiving the
image byte[] from the DB.

I have since found a way by using a DataReader. So problem solved.

Thanks again for the post!
-Steve
 
J

John Nurick

Hi Steve,

I suspect you may find it simpler not to bother with the OLE wrapping
and instead just store the contents of the image files in a blob (OLE)
field, plus filename in a text field and any otehr metadata.

I don't know about ADO.NET, but ADODB and DAO both offer AppendChunk()
and GetChunk() methods to store and retrieve data, and the ADODB field
object has an ActualSize property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top