Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Sydney 10.4 SQLite Encryption "Funktionalität wird nicht unterstützt" (https://www.delphipraxis.net/205134-sydney-10-4-sqlite-encryption-funktionalitaet-wird-nicht-unterstuetzt.html)

schotti65 4. Aug 2020 11:35

Datenbank: sqlite • Version: 3 • Zugriff über: Firedac

Sydney 10.4 SQLite Encryption "Funktionalität wird nicht unterstützt"
 
Eine SQLite Datenbank soll mit Encryption geöffnet werden.
Der folgende Code hat bis 10.3 funktioniert, bei 10.4 kommt die Fehlermeldung "Funktionalität wird nicht unterstützt":
Code:
   FLocalServerConnection := TFDConnection.Create(Self);
   ...
   FLocalServerConnection.Open('DriverID=SQLite;Database=dieDatenbankdatei;Password=aes-ecb-256:geheim');
Der Parameter "Password=..." aktiviert die Encryption und führt letztlich in FireDAC.Phys.SQLiteWrapper.pas zu der Prüfung, ob die dazu nötige Funktion vorhanden ist:
Code:
procedure TSQLiteDatabase.Key(const AKey: String);
...
  if Assigned(Lib.Fsqlite3_key) then begin
   ...
  end
  else
    FDCapabilityNotSupported(nil, [S_FD_LPhys, S_FD_SQLiteId, 'sqlite3']);
end;
Und jetzt kommt der Unterschied zwischen 10.3. und 10.4.:Während in 10.3 in FireDAC.Phys.SQLiteCli.pas noch die Funktion sqlite3_key(...) explizit deklariert war, ist sie es in 10.4 nicht mehr, und wird deshalb nur in sqlite3.dll gesucht.
Und da ist sie nicht.

Wer weiss Rat?

TurboMagic 4. Aug 2020 12:54

AW: Sydney 10.4 SQLite Encryption "Funktionalität wird nicht unterstützt"
 
Schon mal in QP (quality.embarcadero.com) geschaut, ob das ein bekanntes Problem ist?

Rollo62 4. Aug 2020 13:22

AW: Sydney 10.4 SQLite Encryption "Funktionalität wird nicht unterstützt"
 
Vielleicht hat es damit zu tun ?

Delphi-Quellcode:
  , FireDAC.Phys.SQLiteWrapper.Stat //23.06.20 added to prevent Rx1040 link error
  // https://stackoverflow.com/questions/62086198/cannot-load-sqlite-libraries-in-android-with-delphi-10-4

schotti65 4. Aug 2020 14:14

AW: Sydney 10.4 SQLite Encryption "Funktionalität wird nicht unterstützt"
 
Das wars - vielen Dank für den Tipp!

Es gibt einen Eintrag im QP.
Man muss das statische Linken erzwingen durch einbinden der "FireDAC.Phys.SQLiteWrapper.Stat":
Zitat:

Starting from 10.4 FireDAC SQLite driver supports static and dynamic linkage of SQLite3 engine. Only statically linked SQLite3 engine supports encryption. If somehow dynamically linked engine is used and application requests encryption of SQLite database, then error "Capability is not supported" is returned.
...
2) To use statically linked engine, your application must include FireDAC.Phys.SQLiteWrapper.Stat unit into uses clause. This unit will be added automatically by IDE for new/modified forms/modules which has TFDConnection configured to use FireDAC SQLite driver. Or you can add this unit by hands
Jetzt läufts (kA warum es bei 10.3 auch ohne die unit ging, aber egal)

TurboMagic 5. Aug 2020 07:04

AW: Sydney 10.4 SQLite Encryption "Funktionalität wird nicht unterstützt"
 
Wär's möglich die QP Report Nummer zu posten?

MEissing 5. Aug 2020 10:32

AW: Sydney 10.4 SQLite Encryption "Funktionalität wird nicht unterstützt"
 
https://quality.embarcadero.com/browse/RSP-29783


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:22 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz