By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 2,402 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

Read binary record from Database with ADODB.Stream

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.