Click to See Complete Forum and Search --> : Image storing


adiseshukumar
May 28th, 2001, 04:30 AM
hai,
can any body help me?i want to write an image into oracle database and want to retrive back.i know that i should use BLOB data type but i don't know how to writwe the image into the column
please help me..
seshu

<font color=blue>Seshu</font>

O.K
May 28th, 2001, 06:28 AM
Hi,

try to implement this code

Open Filename for binary as #1
RS.Addnew
RS.Fields(Fieldname).Value = InputB(LOF(#1), #1)
RS.Update
close #1



(you'll have to open the recordset etc... "Filename" and "Fieldname" are variables ;-) )

when you'll like to get the image out of the oracle-db you'll have to select the recordset and save the data like this:

Put #1, , RS.Fields(Fieldname).Value



but be patient: 'cause of it's variable length vb puts 12 bytes with the length as information before the original data. I don't have a very good solution for this, only "copying" this file to a new file (starting at byte 13).

Bye,
O.K