467,876 Members | 1,207 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,876 developers. It's quick & easy.

Read binary record from Database with ADODB.Stream

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 -
Jul 22 '05 #1
  • viewed: 4208
Share:
1 Reply
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

"guyv" wrote:
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 -

Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

26 posts views Thread by Patient Guy | last post: by
23 posts views Thread by ShaneO | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.