[FireDAC] [Phys] [SQLite] ERROR

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

[FireDAC] [Phys] [SQLite] ERROR

Postby Lena » Tue Aug 09, 2016 2:56 am

DB mikros.s3db added to the Android project. I see it in deployment here. \ assets \ internal \
When I deploy the application on all phones work as expected.
On Android tablets get [FireDAC] [Phys] [SQLite] ERROR: unable to open database file
How To Fix for tablets? Thank you.
Code: Select all
void __fastcall TForm1::FDConnection1BeforeConnect(TObject *Sender)
{
 #if defined(_PLAT_IOS) || defined(_PLAT_ANDROID)
   FDConnection1->Params->Values["Database"] =
   System::Ioutils::TPath::Combine(System::Ioutils::TPath::GetDocumentsPath(), "mikros.s3db");
 #endif
}
Lena
BCBJ Master
BCBJ Master
 
Posts: 444
Joined: Sun Feb 06, 2011 1:28 pm

Re: [FireDAC] [Phys] [SQLite] ERROR

Postby Lena » Tue Aug 09, 2016 3:28 am

After install app in tablet I see mikros.s3db here data/data/com.embadcadero.mikros/files
But got on tablet [FireDAC] [Phys] [SQLite] ERROR: unable to open database file
Lena
BCBJ Master
BCBJ Master
 
Posts: 444
Joined: Sun Feb 06, 2011 1:28 pm

Re: [FireDAC] [Phys] [SQLite] ERROR

Postby Lena » Tue Aug 09, 2016 5:21 am

Code: Select all
__fastcall TForm1::TForm1(TComponent* Owner)
   : TForm(Owner)
{
#if defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR) || defined(__ANDROID__)

   FDConnection1->Params->Values["Database"] =
   System::Ioutils::TPath::Combine(System::Ioutils::TPath::GetDocumentsPath(), "mikros.s3db");



After duplication this code in the Form constructor, it worked with tabled too.
Lena
BCBJ Master
BCBJ Master
 
Posts: 444
Joined: Sun Feb 06, 2011 1:28 pm


Return to Technical

Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests

cron