Difference between revisions of "TSQLDBLibraryLoader"
m (Fixed syntax highlighting) |
|||
(3 intermediate revisions by 2 users not shown) | |||
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}} |
+ | {{Infobox databases}} | ||
+ | |||
+ | {{Warning|This article is still a rough draft; please compare with the official announcement by Michael Van Canneyt on the Free Pascal mailing list and update this page.}} | ||
+ | |||
+ | '''TSQLDBLibraryLoader''' [[image:tsqldblibraryloader.png]] 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 == | == 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. | ||
Line 11: | Line 17: | ||
== Sample code == | == Sample code == | ||
− | <syntaxhighlight> | + | |
+ | <syntaxhighlight lang=pascal> | ||
SQLDBLibraryLoader1.ConnectionType:='SQLite3'; | SQLDBLibraryLoader1.ConnectionType:='SQLite3'; | ||
// Note: .ConnectionType resets the LibraryName, so set LibraryName after | // Note: .ConnectionType resets the LibraryName, so set LibraryName after | ||
Line 20: | Line 27: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | == | + | ==See also== |
− | + | ||
+ | * [[TSQLConnector]] | ||
{{LCL Components}} | {{LCL Components}} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 02:31, 2 March 2020
│
English (en) │
français (fr) │
polski (pl) │
中文(中国大陆) (zh_CN) │
References:
Tutorials/practical articles:
Databases |
Warning: This article is still a rough draft; please compare with the official announcement by Michael Van Canneyt on the Free Pascal mailing list and update this page.
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;
See also