Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Creating Database Files using Firedac (Delphi XE7)


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Feb 27, 2015 8:39 AM Last Post By: Bob Carson
Bob Carson

Posts: 62
Registered: 10/8/04
Creating Database Files using Firedac (Delphi XE7)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 26, 2015 1:27 PM
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;
FDConnection1.Connected := True;
FDTable1.TableName := Trim(Edit6.Text);
FDTable1.CreateTable(True,[tpTable]);
FDTable1.SaveToFile(DATABASE_FILE);

Although I get an error on CreateTable : Cannot create file "DATABASE_FILE" the process cannot access the file since it is used by another process, The SQLite File gets created, data can be entered, and the file can be later read and edited.
My question - Is this possible to create MS Access (mdb) , Interbase (gdb), MySQL, etc. files using XE7 Firedac as I can with SQLite files and DataSnap files (without Firedac) ?
I tried similar to the above code for MS Access DriverID=MSAcc) and Interbase (DriverID=IB), but could not create a valid file. The message is : error while trying to open file, the system cannot find the file specified. This must be happening on FDConnection.Connected since the file has not yet been created. My code is questionable. How can I correct this?
Thanks for any help.

Bob Carson

Posts: 62
Registered: 10/8/04
Re: Creating Database Files using Firedac (Delphi XE7)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 27, 2015 8:39 AM   in response to: Bob Carson in response to: Bob Carson
This can be done if proper drivers are installed. Needed CreateDatabase=yes in parameters list to create gdb file.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02