Using SQlite in Lazarus lazarus / 16-Databases ---------------------------------------------------------------------- hulky · 2005-04-14 18:42 I am trying to use an sqlite database in my lazarus program using the sqlitedb unit (as included with lazarus). When I compile it straight (as fpc-programm) this works fine but as soon as I try to compile it as a lazarus windows programm I get the following error: sqlitedb.pas(341,55) Error: Incompatible type for arg no. 3: ....... etc. Can anybody tell me how to solve this? Regards, Wim ---------------------------------------------------------------------- Anonymous · 2005-10-03 09:42 I got the same thing with the lastest version 0.9.8 beta ! Someone can say how to solve that ? Thankx E.Jourde ---------------------------------------------------------------------- Marc · 2005-10-03 12:32 what is on line: sqlitedb.pas(341,55) ? ---------------------------------------------------------------------- Anonymous · 2005-10-03 13:34 ok i don't uses the TSQliteDataset compoment, but the test.pp program (wich use sqlite and sqlitedb) there is this :     fError := SQLite_Exec(fSQLite, Psql, @ExecCallback, Self, @fPMsg); who don't want compile with incompatible type of arg no. 3 Tanks ---------------------------------------------------------------------- Marc · 2005-10-04 11:59 OK, what does SQLite_Exec expect for type of parameter 3 and what is the declaration of ExecCallback ---------------------------------------------------------------------- LuizAmérico · 2005-10-12 21:22 Lazarus only ships with the sqlite TDataset descendant (TSqliteDataset that resides in sqliteds.pas). SqliteDB unit is not mantained/updated/tested AFAIK, so use it at your own risk. Here's a patch to compile sqlitedb.pas (I did not test it with data): Index: sqlitedb.pas =================================================================== --- sqlitedb.pas   (revisão 726) +++ sqlitedb.pas   (cópia de trabalho) @@ -185,14 +185,14 @@    end;  end; -function ExecCallback(Sender: TObject; Columns: Integer; ColumnValues: Pointer; ColumnNames: Pointer): integer; cdecl; +function ExecCallback(Sender: Pointer; Columns: Integer; ColumnValues: PPChar; ColumnNames: PPChar): integer; cdecl;  var    PVal, PName: ^PChar;    n: integer;    sVal, sName: String;  begin    Result := 0; -  with Sender as TSQLite do +  with TSQLite(Sender) do    begin      if (Assigned(fOnData) or Assigned(fTable)) then      begin @@ -213,7 +213,7 @@        sVal := fLstVal.CommaText;        sName := fLstName.CommaText;        if Assigned(fOnData) then -        fOnData(Sender, Columns, sName, sVal); +        fOnData(TObject(Sender), Columns, sName, sVal);        if Assigned(fTable) then        begin          if fTable.Count = 0 then ---------------------------------------------------------------------- felipemdc · 2005-10-12 21:44 Maybe this patch should be sent to the FPC? The unit may be old, but it may still be of some use. ---------------------------------------------------------------------- LuizAmérico · 2005-10-12 22:15 As i said i did not tested the unit so maybe it's not working correctly although compiling. Anyway anyone can look at the code, test it, modify (if necessary) and send the changes to fpc (It's open source ;-)) For myself, i dont have the necessary time/interest in doing so, since i don't see advantages of using it over TSqliteDataset, which i maintain BTW: Where are you from? Luiz