weabow 6 Posted November 12, 2023 (edited) Hi there, I've an app which runs fine on Delphi 11, using crypted (aes-256) SQLite db, throught FireDac. This code no longer runs under Delphi 12. An error is fired from FireDAC.Phys.SQLiteWrapper.pas, procedure TSQLiteDatabase.Key(const AKey: String);, line 2119 : if Assigned(Lib.Fsqlite3_key) then begin... It seems that Lib.Fsqlite3_key is not assigned. Any idea will be very appreciated... Edited November 13, 2023 by weabow Share this post Link to post
Uwe Raabe 2057 Posted November 12, 2023 That is mentioned in the What's New: FireDAC SQLite Version Update Share this post Link to post
Darian Miller 361 Posted November 12, 2023 That same DocWiki page stated "The default linkage mode is static with SQLite version 3.31.1 with FDE." so I would assume it would be backwards compatible. Share this post Link to post
Uwe Raabe 2057 Posted November 12, 2023 It may depend on the uses list and its order. The different Stat units register different default values: {FireDAC.Phys.SQLiteWrapper.FDEStat} initialization TSQLiteLib.GLibClasses[slDefault] := TSQLiteLibFDEStat; TSQLiteLib.GLibClasses[slFDEStatic] := TSQLiteLibFDEStat; {FireDAC.Phys.SQLiteWrapper.SSEStat} initialization TSQLiteLib.GLibClasses[slDefault] := TSQLiteLibSEEStat; TSQLiteLib.GLibClasses[slSEEStatic] := TSQLiteLibSEEStat; {FireDAC.Phys.SQLiteWrapper.Stat} initialization TSQLiteLib.GLibClasses[slDefault] := TSQLiteLibStat; TSQLiteLib.GLibClasses[slStatic] := TSQLiteLibStat; Manually adding FireDAC.Phys.SQLiteWrapper.FDEStat to the uses may solve the problem. I'd rather set the mode to an explicit value instead relying on a volatile default. Share this post Link to post
weabow 6 Posted November 13, 2023 Thanks for your replies. I've read the FireDAC SQLite Version Update and I understand I have to use option 3 : Continue using SQLite 3.31.1 or previous versions with FireDAC encryption (FDE). But I didn't see anywhere how to do that (sorry, it's not my best expertise). What's the code I need to put and where ? Share this post Link to post
weabow 6 Posted November 13, 2023 (edited) [SOLVED] I've put on app boot a on the main form : TFDPhysSQLiteDriverLink, with the property : EngineLinkage -> sIFDEStatic Maybee an idea do do that from code ? Edited November 13, 2023 by weabow 2 1 Share this post Link to post
emileverh 21 Posted November 13, 2023 May be a stupid question; but I am correct with the option 'EngineLinkage -> sIFDEStatic' I don't need any external DLL? ( Now I deploy sqlite3.dll to all my clients ). Or is this other behaviour... Share this post Link to post
weabow 6 Posted November 13, 2023 I think it depends on the OS target. On Windows, I do not add any file On Android, I add lib-native-activity.so On MacOs I add libcdsqlite.dylib and libcrypto.dylib On IOS I add ... nothing On Linux I add ... nothing But I'm not sure all these libraries concern SQLite Share this post Link to post
emileverh 21 Posted November 13, 2023 5 minutes ago, weabow said: I think it depends on the OS target. On Windows, I do not add any file On Android, I add lib-native-activity.so On MacOs I add libcdsqlite.dylib and libcrypto.dylib On IOS I add ... nothing On Linux I add ... nothing But I'm not sure all these libraries concern SQLite Great! I work only on the Windows platform. One DLL less 😉 So the Embarcadero guys did a translation found on the SQLITE.ORG source code to Delphi-Pascal? Share this post Link to post
Fr0sT.Brutal 900 Posted November 17, 2023 On 11/13/2023 at 10:46 AM, emileverh said: So the Embarcadero guys did a translation found on the SQLITE.ORG source code to Delphi-Pascal? They just use OBJ just like with Zip and RegExp Share this post Link to post
braunbaer 2 Posted December 8, 2023 On 11/13/2023 at 7:45 AM, weabow said: [SOLVED] I've put on app boot a on the main form : TFDPhysSQLiteDriverLink, with the property : EngineLinkage -> sIFDEStatic Maybee an idea do do that from code ? You saved my day. kind regards gebhard Share this post Link to post
o815 0 Posted February 23 If someone want this in code, not in UI Designer: I just created an object "FDPhysSQLiteDriverLink " at initialization and set the property. Works for me. uses FireDAC.Phys.SQLiteWrapper.FDEStat, FireDAC.Phys.SQLiteWrapper, ... var FDPhysSQLiteDriverLink : TFDPhysSQLiteDriverLink; initialization FDPhysSQLiteDriverLink := TFDPhysSQLiteDriverLink.Create(nil); FDPhysSQLiteDriverLink.EngineLinkage := slFDEStatic; // compatibility Delphi >=12 finalization FDPhysSQLiteDriverLink.Free; end. Share this post Link to post
weabow 6 Posted February 23 No way for me to have the TFDPhysSQLiteDriverLink with those uses... Can't find library Share this post Link to post
Cristian Peța 103 Posted February 23 (edited) @weabow TFDPhysSQLiteDriverLink is in FireDAC.Phys.SQLite.pas But if you copy-paste from here it won't work because after last "k" character there are some non-visible chars: EF BB BF EF BB BF Edited February 23 by Cristian Peța Share this post Link to post
kabiri 3 Posted April 13 (edited) i add unit FireDAC.Phys.SQLiteWrapper.FDEStat and now work Edited April 13 by kabiri Share this post Link to post
Beto'o 0 Posted June 18 On 11/13/2023 at 1:46 AM, emileverh said: Great! I work only on the Windows platform. One DLL less 😉 So the Embarcadero guys did a translation found on the SQLITE.ORG source code to Delphi-Pascal? where i have to add this file for android: "On Android, I add lib-native-activity.so" and where is located this file? Share this post Link to post
Dave Nottage 557 Posted June 18 1 hour ago, Beto'o said: where i have to add this file for android: "On Android, I add lib-native-activity.so" and where is located this file? You should not have to add that file yourself, as it is added automatically by the IDE. Here's the Deployment Manager for a typical Android project: 1 Share this post Link to post
Beto'o 0 Posted June 19 18 hours ago, Dave Nottage said: You should not have to add that file yourself, as it is added automatically by the IDE. Here's the Deployment Manager for a typical Android project: I get an error message and I found the reason I had these two libraries added:FireDAC.Phys.SQLiteWrapper.Stat, FireDAC.Phys.SQLiteDef and it should only be: FireDAC.Phys.SQLiteDef Share this post Link to post
zedm 0 Posted November 18 i have a problem guys, i added a security to my database sqlite3 with component FDSQLiteSecurity1 and its work normal in the project but when i try to open the database in the run time i have this error [FireDAC][Phys][SQLite][sqlite3]-303. Capability is not supported. btw im using delphi 12 Share this post Link to post