[FireDAC][Phys][SQLite]ERROR:unable to open database file. [Edit]

hi, I encountered a problem。
I basically created a page according to the APP.( [page address|http://docwiki.embarcadero.com/RADStudio/XE5/en/Mobile_Tutorial:_Using_FireDAC_in_Mobile_Applications_(iOS_and_Android)] )
After the deployment is complete compilation。
Running on the phone when the error message

[FireDAC][Phys][SQLite]ERROR:unable to open database file.
thank you

Source Code:

implementation

{$R *.fmx}

procedure TForm1.Button1Click(Sender: TObject);
begin
if edit1.Text='' then
   begin
      label1.Text := 'not null';
      edit1.SetFocus;
      abort;
   end;
if edit2.Text='' then
   begin
      label1.Text := 'not null';
      edit2.SetFocus;
      abort;
   end;
FDConnection1.Open();
with fdquery1 do
begin
    sql.Clear;
    sql.Add('insert into xuesheng (name,age) values (''you'',28)');
    execsql;
end;

label1.Text := 'down';

end;

procedure TForm1.FDConnection1BeforeCommit(Sender: TObject);
begin
FDConnection1.Params.Values['Database'] := '$(DOC)/test.s3db';
end;

end.

Edited by: you qingzhi on Sep 25, 2013 6:07 PM

Edited by: you qingzhi on Sep 25, 2013 6:10 PM
0
you
9/26/2013 1:10:54 AM
embarcadero.delphi.firedac 822 articles. 2 followers. Follow

2 Replies
5312 Views

Similar Articles

[PageSpeed] 57

you qingzhi wrote:

> procedure TForm1.FDConnection1BeforeCommit(Sender: TObject);
> begin
> FDConnection1.Params.Values['Database'] := '$(DOC)/test.s3db';
> end;

That should be BeforeConnect, not BeforeCommit.

-- 
Dave Nottage [TeamB]
0
Dave
9/26/2013 2:01:26 AM
> {quote:title=Dave Nottage wrote:}{quote}
> you qingzhi wrote:
> 
> > procedure TForm1.FDConnection1BeforeCommit(Sender: TObject);
> > begin
> > FDConnection1.Params.Values['Database'] := '$(DOC)/test.s3db';
> > end;
> 
> That should be BeforeConnect, not BeforeCommit.
> 
> -- 
> Dave Nottage [TeamB]

e........
 thanks

Edited by: you qingzhi on Sep 26, 2013 3:46 AM
0
you
9/26/2013 10:46:53 AM
Reply:

Similar Artilces:

[FireDAC][Phys][SQLite] Error: database is locked
I am trying to parse a Memo field and write records to an SQLite database in Delphi XE5. I have a grid open to display the Table. Before the parsing begins, I set FDTable1 to Append mode. Then I parse a number of lines within the Memo and after the last line associated with that record, I set the individual database fields and do an FDTable1.Post. At that point, the first record appears in the grid correctly and I get the following error message: [FireDAC][Phys]{SQlite] Error: database is locked. When I close the program, the record has not been permanently written to the database....

dbexpress sqlite unable to open database file [Edit]
I m use delphi x6 trial, i m create a simple application with firemonkey desktop, and create withs sqlitemanager a database test1.sqlite3 i m adding a form with component dbexpress: sqlconnection1! the path is c\utenti\utente\desktop and database test1.sqlite3 test is ok. i am addind table1 where sqlconnection = sqlconnection1, so i m addind datasetprovider1 and set property daset = table1,so i a m adding clientadaset adn set property providername= datasetprovider1 and property active = true, so addind datasource where property dataset = clientadaset1. so right click on clientdaset and s...

FireDAC mobile app error as sqlite as delphi XE7 [Edit]
i im trying of connect my app as FireDAC but i have some errors. I follor all steps of Mobile_Tutotils_en_pdf file for delphi XE7. First i add one FireDAConnection compoent, after i in FireDAConnection Edito i set DriverID as Sqlite, in Database parameter i set this existing sqlite database "shoplist.s3db i create this database and table as other tool, and i can to add this to DBExpres in data exploer and i can to use it in one mobile delphi project", and i set lockingmode to normal as this manual tell. After as tell in page 269 of this manual when i click over test button, i ...

FireDAC mobile app error as sqlite as delphi XE7 [Edit] #2
i im trying of connect my app as FireDAC but i have some errors. I follow all steps of Mobile_Tutotils_en_pdf file for delphi XE7. First i add one FireDAConnection compoent, after i in FireDAConnection Edit i set DriverID as Sqlite, in Database parameter i set this existing sqlite database "shoplist.s3db , and i set lockingmode to normal as this manual tell. I After i follow steps 1,2,3,4 and in the step 5 of the page 265 when i try of to set Connected property to true, i get this error: 1. [FireDac][Comp][Clnt]-340. Driver ID is not defined. Set TFDConnection.DriverName or Add D...

Link Error: Cannot open FIREDAC.PHYS.OBJ in C++ XE7 [Edit]
When I try to compile and link a C++ XE7 console application I get the link error: [ilink32 Error] Fatal: Datei 'FIREDAC.PHYS.OBJ' kann nicht geöffnet werden >> in English: File ... cannot be opened I cannot find this file in the C:\Program Files (x86)\Embarcadero\Studio\15.0 folder! I do not have this problem with a C++ VCL Forms application My application is a mixed C++/Delphi application, which links Delphi units to the project. The FireDAC components are only used in the Delphi units. Any clues? Thanks, Bruno Edited by: Bruno Buesser on Apr 15, 2015...

Unable to open the physical file. Operating system error 5: "5(Access is denied.)". A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
PLEASE TELL ME A SOLUTION.... Server Error in '/PS' Application. The '/PS' is virtual directory of Local Host.Unable to open the physical file "G:\Personal Site Kit\App_Data\personal.mdf". Operating system error 5: "5(Access is denied.)".An attempt to attach an auto-named database for file G:\Personal Site Kit\App_Data\personal.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. Description: An unhandled exception occurred during the execution of the current web request. Please review th...

[ilink64 Error] Fatal: Unable to open file 'PROGRAM FILES (X86)\FASTREPORT [Edit]
Hello, i managed to compile all source-code files of a larger project with bcc64 (C++Builder4Update1). After fixing a lot of code producing bbc64 and ilink64 errors I get now: [ilink64 Error] Fatal: Unable to open file 'PROGRAM FILES (X86)\FASTREPORTS\LIBD18X64;C:\USERS\PUBLIC\DOCUMENTS\RAD STUDIO\11.0\DCP\WIN64' I don't use FastReports! The whole project can be build with bcc32 and ilink32 without problem. (beside ) The output of ilink64 in the IDE is attached. Can someone give me a hint? The path "C:\Program Files (x86)\FastReports\LibD18x64" is adde...

[FireDAC][Phys][SQLite]ERROR:no such table:Employee
[FireDAC][Phys][SQLite]ERROR:no such table:Employee > {quote:title=ww6 wuxu wrote:}{quote} > [FireDAC][Phys][SQLite]ERROR:no such table:Employee http://docwiki.embarcadero.com/RADStudio/XE6/en/Mobile_Tutorial:_Using_FireDAC_in_Mobile_Applications_(iOS_and_Android) C++ (only for iOS): void __fastcall TForm1::FDConnection1BeforeConnect(TObject *Sender) { FDConnection1->Params->Values["ColumnMetadataSupported"] = "False"; FDConnection1->Params->Values["Database"] = System::Ioutils::TPath::Combine(System::Ioutils::TPath::GetDocumentsPa...

Creating Database Files using Firedac (Delphi XE7)
I have been able to get Firedac to display and edit the following file types in a simple app using FDConnection, FDTable, FDPhysSQLiteDriverLink (and others according to file type) : sdb, gdb, mdb and xls (with ODBC link and drivers). I have been able to create a SQLLite File (.sdb) from scratch and add tables using roughly: FDTable1.Connection = FDConnection1; (set in form) FDConnection1.Params.Clear; FDConnection1.Params.Add('DriverID=SQLite'); FDConnection1.Params.Add('Database='+DATABASE_FILE); FDConnection1.ResourceOptions.DefaultParamType := ptOutput; ...

FireDAC mobile app error as sqlite as delphi XE7
i im trying of connect my app as FireDAC but i have some errors. I follor all steps of Mobile_Tutotils_en_pdf file for delphi XE7. First i add one FireDAConnection compoent, after i in FireDAConnection Edito i set DriverID as Sqlite, in Database parameter i set this existing sqlite database "shoplist.s3db i create this database and table as other tool, and i can to add this to DBExpres in data exploer and i can to use it in one mobile delphi project", and i set lockingmode to normal as this manual tell. After as tell in page 269 of this manual when i click over test button, i ...

FireDAC XE6 unable to connect to MySQL database [Edit]
Hello, today I created my first database app with Delphi XE6 professional (+ Firedac client/server). While there was no problem with Firebird database, I can not connect to MySQL database. As it's my first database application, I have to describe all the steps in detail; 1. I created vcl form app 2. I put FDConnection component, changed drivername to FB 3. In params: DriverID=FB Database=D:\EMPLOYEE.FDB User_Name=SYSDBA Password=masterkey Protocol=TCPIP Server=localhost changed connected to True; (connection is OK after these steps) 4. I added TFDQuery, changed connection...

Unable to upgrade FireDAC with XE6 Professional
Hi, We have XE6 Professional and FireDAC Addon Pack license. I select "Modify, Repair, Uninstall" from Start Menu, then select "Upgrade" and enter FireDAC Addon Serial. Then I proceed the setup as it is. Somewhere around %61 it gets error 2343. Tried the registry trick from support.codegear.com/article/39559 although it is for Delphi 2009; but that did not work. What should I do? Thank you. Edited by: Alper Kaya on Jul 2, 2014 5:43 AM It seems I was supposed to use License Manager and Register FireDAC Addon Serial from there. I do not need to "Upgrade&...

XE5 Data Exploer for encrypted SQLite files from Firedac? [Edit]
Using XE5 We use aes-256 on sqlite files. But appears Firedac uses a non standard for doing so? Which means I can't seem to open these files in Data Explorer as that uses DBX which can't seem to access these encrypted files. Rebuilt the files with no encryption and worked fine. Any workaround for this? besides building the data twice? takes 3.5 hours to build the data each time. Having problems trying to figure out how to setup the connection in Data Explorer.. the documentation like most else where seems to stink. Basically, is there any data viewer in XE5 that ca...

Link Error: Cannot open FIREDAC.PHYS.OBJ in C++ XE7
When I try to compile and link a C++ XE7 console application I get the link error: [ilink32 Error] Fatal: Datei 'FIREDAC.PHYS.OBJ' kann nicht geöffnet werden >> in English: File ... cannot be opened I do not have this problem with a VCL Forms application I even cannot find this file in the C:\Program Files (x86)\Embarcadero\Studio\15.0 folder! Any clues? Thanks, Bruno ...