Difference between revisions of "TSQLDBLibraryLoader"
m (moved SQLDBLibraryLoader to TSQLDBLibraryLoader: Consistency with other component articles on the wiki) |
|||
Line 1: | Line 1: | ||
− | + | '''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]]. | |
− | 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. | ||
== Use and alternatives == | == 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. | 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. | ||
− | + | SQLDBLibraryLoader needs to be called ''before'' loading/enabling TSQLConnection components. | |
− | |||
− | + | 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 that often you can 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.''}} | {{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.''}} | ||
Line 27: | Line 23: | ||
'''This article is still a rough draft; please compare with the official announcement by Michael Van Canneyt on the FreePascal mailing list and update this page.''' | '''This article is still a rough draft; please compare with the official announcement by Michael Van Canneyt on the FreePascal mailing list and update this page.''' | ||
− | |||
{{LCL Components}} | {{LCL Components}} | ||
Revision as of 13:01, 18 July 2016
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.
SQLDBLibraryLoader needs to be called before loading/enabling TSQLConnection components.
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.
Sample code
SQLDBLibraryLoader1.ConnectionType:='SQLite3';
// Note: .ConnectionType resets the LibraryName, so set LibraryName after
// setting ConnectionType!!
SQLDBLibraryLoader1.LibraryName := 'c:\path_to_sqllite_library\sqlite3.dll';
SQLDBLibraryLoader1.Enabled := true;
SQLDBLibraryLoader1.LoadLibrary;
Work in progress
This article is still a rough draft; please compare with the official announcement by Michael Van Canneyt on the FreePascal mailing list and update this page.