IOS sqlite database creation

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
josecarlos
Posts: 36
Joined: Sat 30 Jul 2011 18:35
Location: Brazil
Contact:

IOS sqlite database creation

Post by josecarlos » Tue 07 Aug 2012 18:56

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: IOS sqlite database creation

Post by AlexP » Wed 08 Aug 2012 10:19

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

Post Reply