Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Displaying BLOB Object in Visual Basic

Displaying BLOB Object in Visual Basic

From: <sumanp_at_yardi.com>
Date: 2000/04/19
Message-ID: <8dlc91$ked$1@nnrp1.deja.com>#1/1

One of my tables contains a BLOB FIELD which stores image data (gif image). This has to be displayed in VB form. To access this I have created a store procedure at backend which returns the output in long raw.
But this long raw cannot be access in vb. I am assuming that VB receives
hex value in string. Could you please guide me? How do I convert the
value to store this into .gif file?

The file of size 476 stored in BLOB field is retrived as string of size 1904 in hex. Storing it as it is does not work out.

Stored Procedure:



create or replace procedure readlob( bdata OUT long RAW) AS src_lob BLOB;
amt BINARY_INTEGER := 32767;
pos INTEGER := 1;
lrw long raw;
begin
select gif_img into src_lob from imgs where id=1; amt:=DBMS_LOB.getlength(src_lob);
DBMS_LOB.READ (src_lob, amt,1, lrw);
bdata :=lrw;
end;

vb code



Dim con As New ADODB.Connection
Dim com As New ADODB.Command
Dim buffer As Variant
Dim Fname As String
con.Provider = "msdaora"
con.Open , "scott", "tiger"
com.CommandType = adCmdStoredProc
com.CommandText = "readlob"
com.ActiveConnection = con
com.Parameters(0).Direction = adParamOutput
com.Parameters(0).type = adVariant
com.Execute

buffer = com.Parameters(1).Value
... ... ...

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Apr 19 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US