DataSnap.FireDAC DBX Sample

From RAD Studio Code Examples
Jump to: navigation, search

This is a sample application that shows how to use DataSnap in combination with dbExpress for client-server communications and FireDAC to handle data on the client side.

Location

You can find the DataSnap FireDAC dbExpress sample project at:

  • Start | Programs | Embarcadero RAD Studio Alexandria | Samples and then navigate to:
    • Object Pascal\DataSnap\FireDAC_DBX
  • Subversion Repository:
    • You can find Delphi code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.

Description

This is a client-server application where the server application is a DataSnap server which provides access to a database, and the client application uses dbExpress to communicate with the server, and FireDAC to shows the contents of two tables from the server application. You can perform modifications on the client application and apply them on the remote database.

DataSnapFireDACDbExpress.png

How to Use the Sample

  1. Navigate to the location given above and open SampleDataSnapFireDAC_DBX_ProjectGroup.groupproj.
  2. Double-click SampleDataSnapFireDAC_DBX_Server.dproj on the Projects Window to make it the active project, and press SHIFT+CTRL+F9 or choose Run > Run Without Debugging to run the server application.
  3. Double-click SampleDataSnapFireDAC_DBX_Client.dproj on the Project Manager to make it the active project, and press SHIFT+CTRL+F9 or choose Run > Run Without Debugging to run the client application.
  4. Select Get Tables on the client application to connect to the server application.

The client application shows two tables, a main table that shows a list of clients, and a second table below that shows a list of orders of a client selected in the main table.

In addition to Get Tables, this sample application provides the following buttons:

  • Post Updates, to send changes that you perform on the grids to the remote database.
  • Cancel Updates, to reset changes that you perform on the grids, returning any modified cells to the value that they have on the remote database.
  • Reverse String, which opens a dialog where you can enter a string, send it to the server application, and have the server application reverse the string character by character and return the reversed string.

The client application also provides two checkboxes to configure the communication between the client application and the server application:

Uses

See Also