0
votes

I am getting an error while using FireDAC with Delphi. I need help to resolve this. I replaced the SQLite library, but no luck.

procedure TForm1.Button3Click(Sender: TObject);
var
  FDConnection1: TFDConnection;
  str_: string;
  rsQ: TFDQuery;
begin

  FDConnection1 := TFDConnection.Create(nil);

  with FDConnection1 do
  begin
    DriverName := 'SQLite';
    str_ := GetCurrentDir+'\SyncData.sqlite3';
    Params.Database := str_;
    Open;
  end;

  rsQ := TFDQuery.Create(Nil);
  rsQ.Connection := FDConnection1;

  rsQ.SQL.Clear;
  rsQ.SQL.Add('update metas set base_version = -1 where metahandle=1');
  rsQ.ExecSQL;

  Try
    if rsQ <> nil then
    begin
      rsQ.Close;
      rsQ.Free;
      rsQ := Nil;
    end;
  except
  end;

  Try
    if FDConnection1 <> Nil then
    begin
      FDConnection1.Close;
      FDConnection1.Free;
    end;
  except
  End;

end;

SQLITE Error "[FireDAC][Phys][SQLite] ERROR: malformed database schema (MmapStatus) - near "(": syntax error."

1
I doubt this has something to do with Delphi or FireDAC. You have broken the database (maybe was encrypted or so). - Victoria
The SQLite library might still be too old. What is returned when executing SELECT sqlite_version() in your program? What is the table definition of MmapStatus? - CL.
I am able to open the db and browse the data in SQLite Browser - Sayee Subramania
So the version of the SQLite client library matches to the one of SQLite Browser (make sure you've linked it properly)? Did you encrypt your database (not likely, but still)? - Victoria
the db is not encrypted. - Sayee Subramania

1 Answers

0
votes

I was using Python when I got this. I had tried to use some code I had developed in python3.7 in python3.5. The versions were out of sync. I regen'd the project in 37 and it worked fine, no schema issues.