How save a picture to SQLite table? lazarus / 43-Android ---------------------------------------------------------------------- magleft · 2023-03-28 13:47 With the help of LAMW's examples I am trying to create an application that among other things will take a photo and store it in the last record of a sqlite table. The table structure is:    CREATE TABLE [EPISKEPSI4](    [IDEPISK3] INTEGER PRIMARY KEY AUTOINCREMENT,    [MERA] DATE DEFAULT CURRENT_DATE,    [FIGURE] BLOB,    [ID_REF] INTEGER); While it saves other elements in the table, it saves the photo in the DCIM folder, it does not save the photo in the table. What am I doing wrong; Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TFvisitland.Button16Click(Sender: TObject);begin  if IsRuntimePermissionGranted('android.permission.CAMERA') and     IsRunt imePermissionGranted('android.permission.WRITE_EXTERNAL_STORAGE') then  begin      Camera1.Filename :='vis_'+inttostr(10)+'_'+FormatDate Time('ddmmyyyyMMssSSS',now())+'.jpg'  ;      Camera1.RequestCode := 12345;      Camera1.TakePhoto;  end  else  ShowMessage('Sorry... Some Runtime Permission NOT Granted ...');end; procedure TFvisitland.FvisitlandActivityResult(Sender: TObject;  requestCode: integer; resultCode: TAndroidResult; intentData: jObject);var  photoPath: string;  photo_id:integer;begin  if resultCode = RESULT_CANCELED then  begin    ShowMessage('Photo Canceled!')  end  else if resultCode = RESULT_OK then //ok...  begin    if requestCode = Camera1.RequestCode then    begin      photoPath:= Camera1.FullPathToBitmapFile ;      DbVisitLandPhoto.close;      DbVisitLandPhoto.OpenOrCreate('ApkAgros.db');      DbVisitLandPhoto.select('Select max(IDEPISK3) from Episkepsi4;') ; // Find Last record      photo_id:=DbVisitLandPhoto.Cursor.GetValueAsInteger(0)    ;      DbVisitLandPhoto.close;      DbVisitLandPhoto.OpenOrCreate('ApkAgros.db');      DbVisitLandPhoto.Up dateImage('EPISKEPSI4','FIGURE','EPISK3',photopath,photo_id);      DbVisitLandPhoto.close;    end;  end  else    ShowMessage('Photo Fail!');end; ---------------------------------------------------------------------- rsu333 · 2023-04-02 06:15 Please ref demo app [sqlitedemo all 4 as well as grid demo] ---------------------------------------------------------------------- magleft · 2023-04-10 14:19 I already tried to modify the examples but I failed to insert the camera photo into the database. I also tried saving the photo in png format and then updating the database but it didn't work. I can't figure out what I'm doing wrong.