get a blob column

Hi,
here is a sample of my code that works
(my blob is a gif file) :

with qryRecupImage do
begin
SetVariable('vMYKEY', valClef) ;
Execute ;

if not LobField('MYBLOB').IsNull then
begin
qryRecupImage.LobField('MYBLOB').SaveToFile('c:\temp\toto.gif') ;
img.Picture.LoadFromFile('c:\temp\toto.gif') ;
end ;
end ;

But I'd like to know if you could give me an other way to assign my picture the blob stored in my database...you know...I think it's a little bit boring to save to a temporary file on my DD and then load it into my image component...

Thanx very very much in advance...,
Laurent
 
A TLOBLocator is a TStream descendant, so if your img.Picture also has a LoadFromStream method, you can simply pass LOBField('MYBLOB') to it.

------------------
Marco Kalter
Allround Automations
 
Back
Top