Recent

Author Topic: Function ParamByName don't exist on UIB2.  (Read 3874 times)

marcosmodolo

  • New member
  • *
  • Posts: 9
Function ParamByName don't exist on UIB2.
« on: June 08, 2005, 09:11:06 pm »
Hi,

  I'm trying to insert a image in firebird with UIB2 with a function that I use on delphi, but on UIB2 and lazarus don't exist the function parambyname. How can I  resolve this problem? The function that I'm using is below:

=================================================

//SALVA IMAGEM BMP NO BANCO, QUANDO JPEG DA PROBLEMA
procedure TForm1.Button2Click(Sender: TObject);
var
b:TMemoryStream;
MyJPEG : TJPEGImage;
begin
  qfoto.sql.clear;
  qfoto.sql.add('insert into fotos (foto)');
  qfoto.SQL.Add('values (:image_foto)');
  try
    b:=TMemoryStream.Create;
    MyJPEG := TJPEGImage.Create;
    myjpeg.LoadFromFile(openimage.FileName);
    myjpeg.SaveToStream(b);
    qfoto.ParamByName('image_foto').LoadFromStream(b,ftBlob);
    qfoto.
    qfoto.ExecSQL;
    Application.MessageBox('Imagem inserida com sucesso','Sucesso :');
  except
  on e:exception do
     begin
       Application.MessageBox(Pchar(e.message),'Erro ao inserir image :');
       b.Destroy;
       Exit;
     end;
  end;
  b.Destroy;
  myjpeg.Free;
end;
===============================================

Tks,

Marcos Módolo

Galileo

  • New Member
  • *
  • Posts: 22
Function ParamByName don't exist on UIB2.
« Reply #1 on: June 08, 2005, 10:31:17 pm »
Marcos:

You can post your question too in the Forums of Progdigy, especially in the UIB forum:

http://www.progdigy.com/modules.php?name=Forums&file=viewforum&f=4

I think that they can help you more accuracy.

Have a nice day. Eduardo.

marcosmodolo

  • New member
  • *
  • Posts: 9
Function ParamByName don't exist on UIB2.
« Reply #2 on: June 08, 2005, 10:45:36 pm »
Thank you!

I resolved it by changing the function for this:

qfoto.paramssetblob('image_foto',b);

Have a nice day for you too.

Marcos Módolo

 

TinyPortal © 2005-2018