Take the image through OpenDialog and record in the Blob Field of BDE FireBird 2.5 - delphi


  • QA Engineer

    We need to take pictures through opendialog and put the file on the button. blob- Half base Firebird♪ In the absence of good experience, I cannot match and adjust the code for myself (in those examples that have been seen). As long as I've learned it's worth doing through the flow, and this is a special thing for me... Who cares?

        IBQuery2.Open; 
        IBQuery2.Active:=false; 
        IBQuery2.Edit; 
        IBQuery2.SQL.Add('insert into MainTable (img) VALUES (?img)'); 
        (IBQuery1.FieldByName('IMG') as TBlobField).LoadFromFile(OpenDialog1.FileName);
        IBQuery2.Active:=true; 
        IBQuery2.ExecSQL;
    

    IBQuery1 has a request for a sample of all fields, that is, he's showing me what's needed when the application is launched. IBQuery2, the request is not written, it is used to request a new line in the base, and then the Blob-field idea needs to write a picture.

    Use standard components Delphi 7 - Interbase, Lazarus - with SQLdb

    delphi 7 / lazarus



  • There's a component of TDBImage. Put it in the interface as a field of OBD and... forward.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2