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-676821a599a73363976027/]

Connect to database:

[crayon-676821a599a7c675263816/]

Delete connection definition:

[crayon-676821a599a7f940858327/]

Set connection definition file name:

[crayon-676821a599a80016733918/]

Load connection definition file:

[crayon-676821a599a82112510069/]

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-676821a599a84574082707/]
You can find Delphi code samples in GitHub Repositories.

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

Exit mobile version