English (en) français (fr)

 Database portal References: Tutorials/practical articles: Databases Advantage - MySQL - MSSQL - Postgres - Interbase - Firebird - Oracle - ODBC - Paradox - SQLite - dBASE - MS Access - Zeos

TSQLDBLibraryLoader is a Lazarus and FPC component that specifies the names and locations of SQLDB database libraries (DLLs/.sos/.dylibs) should be loaded from where. The TSQLDBLibraryLoader component is available on the SQLdb tab of the Component Palette.

Use and alternatives

For SQLDB database connectors, at least recent FPC versions try to load some default library names, but may fail. Using SQLDBLibraryLoader, you can specify the exact filename to load.

Note that often you can do a similar thing by setting the library name for the TSQLConnection descendant you are using. This does depend on that TSQLConnection descendant supporting that functionality.

Note: Support for using SQlite with SQLDBLibraryLoader was added to FPC trunk (2.7.1) and is not available in earlier FPC versions. Possible alternative: InitializeSQLite function in unit sqlite3dyn. Please remove this text if tested.

Sample code

  SQLDBLibraryLoader1.ConnectionType:='SQLite3';
// Note: .ConnectionType resets the LibraryName, so set LibraryName after
// setting ConnectionType!!
SQLDBLibraryLoader1.LoadLibrary;