Read binary record from Database with ADODB.Stream

G

guyv

Hello!

I wanna read binary data from database with ADODB.Stream object.
So I wrote code..

---------
<%
query = "SELECT * FROM Categories"
adoDB.DefaultDatabase = "Northwind"

adoRs.Open query, adoDB, 1

Set rec = Server.CreateObject("ADODB.Record")

'read [Picture] column.
rec = adoRs(3)
------------

And the 'rec' TypeName() is 'Byte()'

But I can't get it to ADODB.Stream. How Can I do?
Or Can I read binary column to another way?


Pardon my poor English.
Thanks.


- GuyV -
 
B

B_O_B

I think ADODB stream requires a physical file. Something like the following
where errorImage is the file path.

Set objStream = Server.CreateObject("ADODB.Stream")
With objStream
.Type = adTypeBinary
.Open
.LoadFromFile errorImage
End With

x = objStream.Read

objStream.Close
Set objStream = Nothing
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top