Difference between revisions of "TSQLDBLibraryLoader"
From Free Pascal wiki
Jump to navigationJump to searchLine 10: | Line 10: | ||
== Sample code == | == Sample code == | ||
<syntaxhighlight> | <syntaxhighlight> | ||
− | SQLDBLibraryLoader1.LibraryName := 'c:\ | + | SQLDBLibraryLoader1.LibraryName := 'c:\path_to_sqllite_library\sqlite3.dll'; |
SQLDBLibraryLoader1.ConnectionType:='SQLite3'; | SQLDBLibraryLoader1.ConnectionType:='SQLite3'; | ||
SQLDBLibraryLoader1.Enabled := true; | SQLDBLibraryLoader1.Enabled := true; |
Revision as of 15:58, 18 December 2012
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
Recent (end of 2012) 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 a similar thing by setting the library name for the TSQLConnection descendant you are using.
Sample code
SQLDBLibraryLoader1.LibraryName := 'c:\path_to_sqllite_library\sqlite3.dll';
SQLDBLibraryLoader1.ConnectionType:='SQLite3';
SQLDBLibraryLoader1.Enabled := true;
SQLDBLibraryLoader1.LoadLibrary;
Work in progress
This article is still a rough draft; please compare with the official announcement by Michael Van Cannety on the FreePascal mailing list and update this page.