Page 1 of 1

IOS sqlite database creation

Posted: Tue 07 Aug 2012 18:56
by josecarlos
Hi,

I am having an issue with the latest UniDac 4.3.8 when my application try to create database.

I am using Delphi XE2 upd 4 hotfix 1.

I am providing the database filename and on the database connect, the Xcode ( 4.2.2 IOS 5.0 ) crash.

The same code works fine on windows,if I set UniConnection.SpecificOptions.ForceCreateDatase to True ( False is the default value ).

I have two Xcodes 4.2.2 and 4.3.2, I am using 4.2.2 to make sure I am using the supported version.

Is there any settings on the connection to use it on an IOS application?

I make a test app, and copy all the source code to the same folder is this ok ?

Thanks in advance,

Jose Carlos

Re: IOS sqlite database creation

Posted: Wed 08 Aug 2012 10:19
by AlexP
hello,

Thank you for the information, we have reproduced and fixed this problem. This fix will be included into the next UniDAC version.
For the time being, to fix this problem, you should correct the SQLUniProvider module in the following way

the strings

Code: Select all

  {$IFNDEF NOSTATIC}  
    FConnectionOptions.Add(TBooleanOption.Create('Direct', prStaticLibrary, [TSQLiteConnection], False));
    FConnectionOptions.Add(TBooleanOption.Create('ForceCreateDatabase', prForceCreateDatabase, [TSQLiteConnection], False));
    FConnectionOptions.Add(TEnumeratorOption.Create('EncryptionAlgorithm', prEncryptionAlgorithm, [TSQLiteConnection], Variant(leDefault), TypeInfo(TLiteEncryptionAlgorithm)));
  {$ENDIF}
change with (carry the ForceCreateDatabase out of IFDEF)

Code: Select all

    FConnectionOptions.Add(TBooleanOption.Create('ForceCreateDatabase', prForceCreateDatabase, [TSQLiteConnection], False));
  {$IFNDEF NOSTATIC}  
    FConnectionOptions.Add(TBooleanOption.Create('Direct', prStaticLibrary, [TSQLiteConnection], False));
    FConnectionOptions.Add(TEnumeratorOption.Create('EncryptionAlgorithm', prEncryptionAlgorithm, [TSQLiteConnection], Variant(leDefault), TypeInfo(TLiteEncryptionAlgorithm)));
  {$ENDIF}
and set the ForceCreateDatabase option in the connection SpecificOptions to True