Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Learn How To Easily Work With Delphi Database Connection Definitions With This Sample

The ConnectionDefs property is a powerful tool that can be used to make your connections management simple and flexible, with the possibility of persisting and transport your connection’s parameters whenever you want, using these transportable files you can load and navigate between previously configured connections on self-contained .INI files, thus, you don’t have to worry about load and save settings on settings files yourself, this is all abstracted within connectionDef’s functions.

ConnectionDefs requires just the actual native FireDac installed.

To use the ConnectionDefs function just add the TFDManager  on your code, after that you can:

Create connection definition on fly:

[crayon-67402afeaed18618913825/]

Connect to database:

[crayon-67402afeaed21034888978/]

Delete connection definition:

[crayon-67402afeaed23904588156/]

Set connection definition file name:

[crayon-67402afeaed24090685063/]

Load connection definition file:

[crayon-67402afeaed26816196267/]

Add connection definition:

This is similar to create connection definition. The difference is that you may create a connection definition after loading other connection definitions from the file.

Clone Connection definition:

[crayon-67402afeaed27766219175/]
You can find Delphi code samples in GitHub Repositories.

Check out the full article in the DocWiki about the ConnectionDefs.

Exit mobile version