473,701 Members | 2,530 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.DefaultDa tabase = "Northwind"

adoRs.Open query, adoDB, 1

Set rec = Server.CreateOb ject("ADODB.Rec ord")

'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
1 5246
I think ADODB stream requires a physical file. Something like the following
where errorImage is the file path.

Set objStream = Server.CreateOb ject("ADODB.Str eam")
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.DefaultDa tabase = "Northwind"

adoRs.Open query, adoDB, 1

Set rec = Server.CreateOb ject("ADODB.Rec ord")

'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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9485
by: C | last post by:
Re: Microsoft Knowledge Base Article - 870669 How to disable the ADODB.Stream object from Internet Explorer You may recently have heard of the vulnarability exposed by Internet Explorer as described in that article: "An ADO stream object contains methods for reading and writing binary files and text files. When an ADO stream object is combined with known security vulnerabilities in Internet Explorer, a Web site could execute scripts...
26
4309
by: Patient Guy | last post by:
Has anyone written code that successfully manipulates binary file data using Javascript? It might---and in the case of doing I/O, will---make use of browser- specific functions (ActiveX/COM with Internet Explorer, XPCOM/XPConnect with Mozilla/Firefox). I am writing client-side code that will generate binary data for producing a GIF file through an OBJECT element. (The GIF is an image of a line and points on a two-axis plot.)
68
5233
by: vim | last post by:
hello everybody Plz tell the differance between binary file and ascii file............... Thanks in advance vim
1
2913
by: Pedro Leite | last post by:
hello. got stalled at at point that i can no longer get my thoughts together. the point, is in classic asp, stream an excel file from a firebird database. temporarly save it if necessary stream it to the browser delete the temp file on googling, i found some examples but all assuming that the file is locally
4
6722
by: Pedro Leite | last post by:
Good Afternoon. the code below is properly retreiving binary data from a database and saving it. but instead of saving at client machine is saving at the server machine. what is wrong with my code ?? thank you Pedro Leite From Portugal ------------------------------------
19
2783
by: Genalube | last post by:
I have an application that will produce a Word document based on five separate queries this has required that I create a ADODB connection: 'Create connection to current database Dim Conn As ADODB.Connection Set Conn = CurrentProject.Connection There are five separate recordSets, one for each query. The record sets each fill out a table in the Word document, utilizing bookmarks. Some areas of the Word document have repeating...
23
2827
by: ShaneO | last post by:
Hello, I wish to extract embedded string data from a file using a Binary Read method. The following code sample is used in VB.NET and similar code is used in VB6 - (Assume variable declarations etc.) FileOpen(iFileIn, sInputFile, OpenMode.Binary, OpenAccess.Read)
3
2263
by: smugcool | last post by:
Hi, I have created a form in Visual basic 6.0 for adding/updating the change request made by various users. Well i am able to update the record through my code in access database. Can anyone tell me what code should i use to Add record in the database, i also want the new record which will be added in the access database is having some unique no like CRC-CC-date/month/year-incremental number? I mean as soon anyone will hit the add...
2
2000
by: vegeta456 | last post by:
I have a really strange problem. I am using Microsoft Access 2003 under Windows XP Professional. I am trying to read a CSV file using VBA in Access using the following procedure. Public Sub GetCSV_FileData() Dim cnn As ADODB.Connection Dim cn As ADODB.Connection Dim rs As ADODB.Recordset Dim f As Integer Dim NumberOfRows As Integer
0
8733
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
8649
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9223
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9083
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8975
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8934
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
3102
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2398
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2035
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.