Page 1 of 1

[Mac OS X]UniDac 6.1.6 Encryption causes Runtime-Error 231

Posted: Thu 30 Jul 2015 13:30
by DerPhilip
Hello,

trying to work with an encrypted sqlite-Database in OS X doesn't work anymore since today (???)...

Here is some code, using Delphi XE8 Update 1 (subscription)

Code: Select all

unit Unit2;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
  Uni, UniProvider, SQLiteUniProvider, FMX.Controls.Presentation, FMX.StdCtrls;

type
  TForm2 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form2: TForm2;
  uniconnection: TUniConnection;
  uniquery: TUniQuery;

implementation

{$R *.fmx}

procedure TForm2.Button1Click(Sender: TObject);
var
  dbFile:String;
begin
  uniconnection := TUniConnection.Create(nil);
  uniconnection.ProviderName := 'SQLite';
  uniconnection.SpecificOptions.Values['Direct'] := 'True';

  uniconnection.SpecificOptions.Values['EncryptionAlgorithm'] := 'leAES256';
  uniconnection.SpecificOptions.Values['EncryptionKey'] := 'TesttestTEST';
  uniconnection.SpecificOptions.Values['ForceCreateDatabase'] := 'True';


  {$IFDEF MacOS}
  ForceDirectories(GetHomePath + PathDelim +'Documents' + PathDelim + 'unidacTest');
  {$ENDIF}

  dbFile := {$IFDEF MSWindows}ExtractFileDir(ParamStr(0))+'\sqliteDb.sqlite';{$ENDIF}
            {$IFDEF MACOS}GetHomePath +PathDelim +'Documents'+ PathDelim + 'unidacTest'+ PathDelim +'sqliteDb.sqlite';{$ENDIF}

  uniconnection.Database := dbFile;
end;

procedure TForm2.Button2Click(Sender: TObject);
begin
  uniconnection.Connect;
  uniquery := TUniQuery.Create(nil);
  uniquery.Connection := uniconnection;
  uniquery.SQL.Text := 'CREATE TABLE test (testId, int)';
  uniquery.ExecSQL;
end;

end.
Looking forward for response, thanks!

Philip

Re: [Mac OS X]UniDac 6.1.6 Encryption causes Runtime-Error 231

Posted: Fri 31 Jul 2015 10:17
by MaximG
Thank you for the information. We have reproduced the issue, and we will inform you about the results shortly

Re: [Mac OS X]UniDac 6.1.6 Encryption causes Runtime-Error 231

Posted: Wed 08 Mar 2017 04:55
by Geoputer
Was this issue resolved? I am running RAD Studio 10.2 and still having a problem with Runtime Error 231 on the Mac OS X side. Windows 64 runs perfectly on a VMWare virtual machine...

The app builds fine and begins to run, and I get through your Server sign-on dialog (UniConnectDlgFMX), but then the app just crashes without any warning, before any forms show up. I'm running MySQL on a remote server...on the same network.

Re: [Mac OS X]UniDac 6.1.6 Encryption causes Runtime-Error 231

Posted: Tue 14 Mar 2017 14:48
by MaximG
We have reproduced the problem and fixed the bug. The fix will be included in the next UniDAC build.