Professional Documents
Culture Documents
http://docwiki.embarcadero.com/RADStudio/XE5/en/First_Steps_to_Use...
Contents
1 Introduction 2 Establishing the Connection to the Database 3 Selecting Rows from the Database 4 Preparing the Application for Run Time 5 Summary 6 See Also
Introduction
This tutorial has three main sections: Establishing the connection to the database: how to use Delphi to create an application that will connect to a database. Selecting rows from the database: hook the data up to a grid and display it at design time. Preparing the application for run time : describes the necessary steps to make an application run as a standalone executable (run time). The screenshots and instructions below relate to RAD Studio 2007, so there might be minor changes if you use a different RAD Studio release. Also see the Ron Grove movie: First Steps to Use FireDAC (http://www.youtube.com/watch?feature=player_embedded&v=pZB5_VJfi2Y) .
Here you can enter your user credentials. By default, you have three attempts to enter valid credentials. If they all fail, the login process also fails and you will get an error message. Press the OK button to establish the connection to the DB and to create a user session on the DBMS if this DBMS supports this feature.
1 of 3
12/24/2013 3:51 PM
http://docwiki.embarcadero.com/RADStudio/XE5/en/First_Steps_to_Use...
After the connection is successfully established, the Connected property should still be set to True, otherwise it will be reset to False and FireDAC will display an appropriate error message.
Press the OK button to close the editor. This stores the SQL command text into the TFDQuery component's SQL property. Next, drop a standard Delphi TDataSource component from the "Data Access" palette page onto your form. Set its DataSet property to FDQuery1. Now drop a TDBGrid control onto the form from the "Data Controls" page and set its DataSource property to DataSource1. Finally, set FDQuery1's Active property to True. This sends the SQL command to the DBMS, which executes the command and returns a result set. This data is displayed by the DBGrid1 control:
Summary
2 of 3
12/24/2013 3:51 PM
http://docwiki.embarcadero.com/RADStudio/XE5/en/First_Steps_to_Use...
This article has provided a tutorial showing how to create a simple client-server application using FireDAC for Delphi. It shows how to use the FireDAC connection and query components to establish a connection to the DB and return rows to the client without actually writing any code. We suggest that you also read the Setting up Connections article for all the details on how to setup the connection definitions. For other DBMS Getting Started demo applications, see the FireDAC\Samples\Getting Started folder.
See Also
Overview (FireDAC) Setting up Connections (FireDAC) Mobile Tutorial: Using FireDAC in Mobile Applications (iOS and Android) Retrieved from "http://docwiki.embarcadero.com/RADStudio/XE5/e/index.php?title=First_Steps_to_Use_FireDAC&oldid=211295" Category: FireDAC This page was last modified on 25 October 2013, at 17:29. Help Feedback
3 of 3
12/24/2013 3:51 PM