Jump to content
Sign in to follow this  
pcplayer99

FireDAC, SQLite, iOS, what thing I have missed?

Recommended Posts

Hello,

 

I'm testing if I can debug in iOS, this is my first experience of iOS.

 

Delphi 10.4.2, FireMonkey, FireDAC, SQLite,

 

iOS 15.2

 

Just a test, my code like:

  FDConnection1.Close;
  S := TPath.Combine(TPath.GetDocumentsPath, 'My.db');  //for Android
  FDConnection1.Params.Database := S;
  FDConnection1.Open;  
 
  FdQuery1.Open;
  FdQuery2.Open;

 

FdQuery1.SQL.Text := 'select * from MyTable';

 

in Delphi IDE deployment window, this 'My.db' is in "Remote Path" -- ".\assets\internal\"   -- in Android and iOS, there is the same content.

 

if the target is Windows or Android, it can work fine.

 

if the target is iPhone, when it runs step to FdQuery1.Open, Delphi raise an exception message: 

Project Project1 raised exception class ESQLiteNativeException with message '[FireDAC][Phys][SQLite] ERROR: no such table: MyTable'.

 

The PAServer in MAC shows these messages:

error: Project1 :: Class 'TFDDatSManger' has a base class 'Firedac::Dats::TFDDatSNamedObject which does not have a complete definition.

 

So, there must be some things I have missed ?

 

Thanks.

 

 

Share this post


Link to post

Found reason.

 

This error message is caused by my sqlite db file: "My.db" has not installed into iPhone.

 

It's my fault.

 

The reason is that in Delphi IDE deployment windows, add a file, at the "Remote Path", mouse click and drop down, only one item: ".\assets\internal". So I select this item. I know this item is ok when release Android App.

 

In iOS, it must be: ".\StartUp\Documents\"

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×