Connecting to Multiple Enterprise Databases is no more a time consuming task in making connections and login to databases. FireDAC is a Universal Data Access library for developing applications for multiple devices, connected to enterprise databases. With its powerful universal architecture, FireDAC enables native high-speed direct access from Delphi and C++Builder to InterBase, SQLite, MySQL, SQL Server, Oracle, PostgreSQL, DB2, SQL Anywhere, Advantage DB, Firebird, Access, Informix, DataSnap, and more, including the NoSQL Database MongoDB.
How To Connect With Microsoft SQL Server using FireDAC.
Prerequisites : Ensure Native Microsoft SQL server latest driver is installed and a Microsoft SQL Server installed machine (local or Remote) to connect database.
- Open RAD Studio 10.4.1 -> Navigate to Data Explorer -> Expand FireDAC -> Select Microsoft SQL Server.
- Right Click Add New Connection. Enter the name of the Connection e.g) NorthWind. FireDac Conenction editor is opened with DriverID ‘MSSQL’
- Provide the Server, Database, Username, Password to connect.
- Click the Test Button to check the connection. FireDAC login window with details will be shown. Click Ok. Connection Successful message will be popped up.
- Lot of other options available for your connection establisment. Check out the documentation here.
- Once Successful connection is made, Expand the database which is connected e.g Northwind, you can Expand Tables, Views.
- Create a new Windows VCL Application. Drag and Drop the Table e.g Employee.
- Select the Table and in Object Inspector set the property Active to true.
- Right Click Bind Visually, Which opens the LiveBindings Designer with the TableName.
- Select * in the Table Row. RightClick Link to new Control… Select TStringGrid. That’s all, Table data is populated to String Grid in the Form.
These 10 Simple steps is enough to make your connection with Microsoft SQL Server. Check out the Demonstration here.
Universal FireDAC Connectivity Architecture:
FireDAC Features :
- Data Access Engine : Lightweight, effective and flexible engine can be used directly in applications and serves as a powerful foundation to the datasets API.
- Unified API : FireDAC provides a range of features that help abstract the differences between database systems, making it easy to write code that does not have to be concerned about different DBMS dialects or other subtle differences between DBMSs.
- High- Performance Data Access : Database access is optimized using many different techniques often found only in database-specific components, which let you get faster data access out of the box.
To get started with FireDAC and benefits it offers for developers Check here.
Next, check out the how FMX Login Screens look like in this article.