First FireDAC Application - Felix John COLIBRI. |
- abstract : FireDAC Multi-Device Data Access Library : installation, first Delphi XE3 application with a tAdConnection and tAdQuery
- key words : FireDAC, AnyDAC
- software used : Windows XP Home, Delphi XE3, FireDAC
- hardware used : Pentium 2.800Mhz, 512 M memory, 140 G hard disc
- scope : Delphi Xe3, FireDAC
- level : Delphi developer
- plan :
1 - FireDAC announcement Embarcadero announced yesterday (2013-02-28) the availability of FireDAC.
Since I am eligible to a free download, I downloaded the product, and tried my first application.
2 - FireDAC installation
The Code Central download (available if you satisfy the conditions) was very quick. The result was:
The installation was straigthforward: | clic the .EXE | |
the installation dialog is displayed | | "Next" |
| the dialog asks which sql engines you want to select
| we added Interbase Firebird | |
the Interbase Firebird connection parameters were required |
| we entered our Firebird 2.5 EMPLOYEE parameters | |
some ODS (On Disc Structure, detected when the drivers is for one Interbase / Firebird version, and the GDB file for another) was detected:
We will fix this later, and since an Access driver is available, we will use this one for our first trial | | the dialog offered to add a start menu entry
| | click "Next" |
| the install dialog was displayed |
| click "Install" | | the installation was finished |
|
3 - First Delphi Xe3 FireDAC Application To get the first application |
start Xe3 | | using the Tool Palette, drop a tAdConnection on the Form |
| double click AdConnection1 | | the connection dialog is displayed
| |
we selected the "Connection Definition Name" combo and selected the "Access Demo" | | Then we clicked "Test" |
| the MS Access login was presented |
| click "Ok" | | the connection was established
| |
we looked for a dataset component, but only found the tAdTable, tAdQuery, tAdStoredProc
We selected the tAdQuery and dropped it on the Form | | AdQuery1 was dropped on the Form, and Connection set to AdConnection1
| | click Sql and type |
| toggle Active to True | |
drop a tDataSource, set DataSet to AdQuery1 | | drop a tDbGrid, set DataSource to DataSource1 |
| voilą : |
We then tried to execute
| type F9 | | a driver exception was displayed:
| |
so we simply dropped a tADPhysMSAccessDriverLink, and typed F9 | | a second exception mentionned a "object factory" :
| | so we dropped a tADGUIxWaitCursor
and then typed F9 | | here is the result :
|
4 - Remarks Just my two cents
- installation and using the "basic" components was quite easy and familiar
- apparently Embarcadero did not have the time to install the component suite with Insallaware. Installation took around 30 seconds. Let's hope they will
keep it that way and will be busy in other areas to worry about changing the installer.
- in a similar vein, the help is a standard .CHM / .PDF. AnyDAC seems to have done a real nice job, and purchasing this company certainly was a smart
move. Let's also mention then the AnyDAC persons seem to be part of the purchase (== be still around to improve the product)
- we expected an ancestor AdDataSet, from which the tAdTable, tAdQuery,
tAdStoredProc would be derived from some "tCustomAdDataset" as usual, to make the poor feller's BDE users transition easier. This does not seem the case. So I guess that this time around the tTable and tQuery are full
fledged access components (not only components to make the migration easier). But I did not investigate more at this stage
- when running the project, it appears that FireDAC requires some other
components. But in any case the messages were to the point. In any case, I tried the "shoot from the hip" approach, and can't complain if it came back biting me. RTFM. You cannot expect major functional improvements without
taking at least the time to learn about those.
- it seems that the demos are biased for Interbase rather than Firebird. Connection to Firebird somehow failed. Either I goofed with my Firebird
parameter, or this is a little parametrization problem. Well, according to some surveys, Firebird is the most popular Delphi Sql Engine. We certainly will investigate later how to connect to Firebird. "I shall return".
- the "multi device" is also worth mentioning. I'm still waiting for the Android Mobile Studio, and will certainly try the FireDAC on this occasion (announced around August)
When the purchase of AnyDAC was announced (current February), some comments mentionned - the product is quite popular and considered by many as more advanced, stable, feature rich than dbExpress (going as far as "what dbExpress should
have been")
- some people were worried about "yet another database component set" and "what about the relation with our DataSnap application". The description page displays that this seems to have been taken care of by Embarcadero
- there were also concerns about the price, the handling of older AnyDAC licences
After the announcement the description specifies how all those concerns are addressed.
Just looking on the three tabs in the Tool Palette, the documentation, all the demos provided, FireDAC looks quite impressive, and is certainly worth more than this quite short half an hour glimpse.
As usual:
- please tell us at fcolibri@felix-colibri.com if you found some errors, mistakes, bugs, broken links or had some problem downloading the file. Resulting corrections will
be helpful for other readers
- we welcome any comment, criticism, enhancement, other sources or reference suggestion. Just send an e-mail to fcolibri@felix-colibri.com.
- or more simply, enter your (anonymous or with your e-mail if you want an answer) comments below and clic the "send" button
- and if you liked this article, talk about this site to your fellow developpers, add a link to your links page ou mention our articles in
your blog or newsgroup posts when relevant. That's the way we operate: the more traffic and Google references we get, the more articles we will write.
5 - References
6 - Comments About this aricle
- Marco CANTU - 2013/03/01 10.55
Great article. The TADQuery is a full fledged component, not just for transition. Is what you'll generally use. The demo database installation is
a bit quirky, but they are used only to try out the sample projects
ed : - please note that Marco's comment was sent shortly after the first publication of our article. The "4 Remarks" section was edited after this
first draft
- it's interesting to have confirmation that the tAdQuery is one of the base components
7 - The author Felix John COLIBRI works at the Pascal
Institute. Starting with Pascal in 1979, he then became involved with Object Oriented Programming, Delphi, Sql, Tcp/Ip, Html, UML. Currently, he is mainly
active in the area of custom software development (new projects, maintenance, audits, BDE migration, Delphi
Xe_n migrations, refactoring), Delphi Consulting and Delph
training. His web site features tutorials, technical papers about programming with full downloadable source code, and the description and calendar of forthcoming Delphi, FireBird, Tcp/IP, Web Services, OOP / UML, Design Patterns, Unit Testing training sessions. |