Difference between revisions of "TSQLDBLibraryLoader"

From Free Pascal wiki
Jump to navigationJump to search
m (Fixed syntax highlighting)
 
(11 intermediate revisions by 3 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.
+
{{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 ==
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.
+
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.
+
{{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 ==
 
== Sample code ==
<syntaxhighlight>
+
 
 +
<syntaxhighlight lang=pascal>
 +
  SQLDBLibraryLoader1.ConnectionType:='SQLite3';
 +
// Note: .ConnectionType resets the LibraryName, so set LibraryName after
 +
// setting ConnectionType!!
 
   SQLDBLibraryLoader1.LibraryName := 'c:\path_to_sqllite_library\sqlite3.dll';
 
   SQLDBLibraryLoader1.LibraryName := 'c:\path_to_sqllite_library\sqlite3.dll';
  SQLDBLibraryLoader1.ConnectionType:='SQLite3';
 
 
   SQLDBLibraryLoader1.Enabled := true;  
 
   SQLDBLibraryLoader1.Enabled := true;  
 
   SQLDBLibraryLoader1.LoadLibrary;
 
   SQLDBLibraryLoader1.LoadLibrary;
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== Work in progress ==
+
==See also==
'''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.'''
+
 
 +
* [[TSQLConnector]]
  
[[Category:Databases]]
+
{{LCL Components}}
[[Category:FPC]]
 
[[Category:Lazarus]]
 

Latest revision as of 01:31, 2 March 2020

English (en) français (fr) polski (pl) 中文(中国大陆)‎ (zh_CN)

Databases portal

References:

Tutorials/practical articles:

Databases

Advantage - MySQL - MSSQL - Postgres - Interbase - Firebird - Oracle - ODBC - Paradox - SQLite - dBASE - MS Access - Zeos
Warning-icon.png

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 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

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.

Light bulb  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.LibraryName := 'c:\path_to_sqllite_library\sqlite3.dll';
  SQLDBLibraryLoader1.Enabled := true; 
  SQLDBLibraryLoader1.LoadLibrary;

See also


LCL Components
Component Tab Components
Standard TMainMenu • TPopupMenu • TButton • TLabel • TEdit • TMemo • TToggleBox • TCheckBox • TRadioButton • TListBox • TComboBox • TScrollBar • TGroupBox • TRadioGroup • TCheckGroup • TPanel • TFrame • TActionList
Additional TBitBtn • TSpeedButton • TStaticText • TImage • TShape • TBevel • TPaintBox • TNotebook • TLabeledEdit • TSplitter • TTrayIcon • TControlBar • TFlowPanel • TMaskEdit • TCheckListBox • TScrollBox • TApplicationProperties • TStringGrid • TDrawGrid • TPairSplitter • TColorBox • TColorListBox • TValueListEditor
Common Controls TTrackBar • TProgressBar • TTreeView • TListView • TStatusBar • TToolBar • TCoolBar • TUpDown • TPageControl • TTabControl • THeaderControl • TImageList • TPopupNotifier • TDateTimePicker
Dialogs TOpenDialog • TSaveDialog • TSelectDirectoryDialog • TColorDialog • TFontDialog • TFindDialog • TReplaceDialog • TTaskDialog • TOpenPictureDialog • TSavePictureDialog • TCalendarDialog • TCalculatorDialog • TPrinterSetupDialog • TPrintDialog • TPageSetupDialog
Data Controls TDBNavigator • TDBText • TDBEdit • TDBMemo • TDBImage • TDBListBox • TDBLookupListBox • TDBComboBox • TDBLookupComboBox • TDBCheckBox • TDBRadioGroup • TDBCalendar • TDBGroupBox • TDBGrid • TDBDateTimePicker
Data Access TDataSource • TCSVDataSet • TSdfDataSet • TBufDataset • TFixedFormatDataSet • TDbf • TMemDataset
System TTimer • TIdleTimer • TLazComponentQueue • THTMLHelpDatabase • THTMLBrowserHelpViewer • TAsyncProcess • TProcessUTF8 • TProcess • TSimpleIPCClient • TSimpleIPCServer • TXMLConfig • TEventLog • TServiceManager • TCHMHelpDatabase • TLHelpConnector
Misc TColorButton • TSpinEdit • TFloatSpinEdit • TArrow • TCalendar • TEditButton • TFileNameEdit • TDirectoryEdit • TDateEdit • TTimeEdit • TCalcEdit • TFileListBox • TFilterComboBox • TComboBoxEx • TCheckComboBox • TButtonPanel • TShellTreeView • TShellListView • TXMLPropStorage • TINIPropStorage • TJSONPropStorage • TIDEDialogLayoutStorage • TMRUManager • TStrHolder
LazControls TCheckBoxThemed • TDividerBevel • TExtendedNotebook • TListFilterEdit • TListViewFilterEdit • TLvlGraphControl • TShortPathEdit • TSpinEditEx • TFloatSpinEditEx • TTreeFilterEdit • TExtendedTabControl •
RTTI TTIEdit • TTIComboBox • TTIButton • TTICheckBox • TTILabel • TTIGroupBox • TTIRadioGroup • TTICheckGroup • TTICheckListBox • TTIListBox • TTIMemo • TTICalendar • TTIImage • TTIFloatSpinEdit • TTISpinEdit • TTITrackBar • TTIProgressBar • TTIMaskEdit • TTIColorButton • TMultiPropertyLink • TTIPropertyGrid • TTIGrid
SQLdb TSQLQuery • TSQLTransaction • TSQLScript • TSQLConnector • TMSSQLConnection • TSybaseConnection • TPQConnection • TPQTEventMonitor • TOracleConnection • TODBCConnection • TMySQL40Connection • TMySQL41Connection • TMySQL50Connection • TMySQL51Connection • TMySQL55Connection • TMySQL56Connection • TMySQL57Connection • TSQLite3Connection • TIBConnection • TFBAdmin • TFBEventMonitor • TSQLDBLibraryLoader
Pascal Script TPSScript • TPSScriptDebugger • TPSDllPlugin • TPSImport_Classes • TPSImport_DateUtils • TPSImport_ComObj • TPSImport_DB • TPSImport_Forms • TPSImport_Controls • TPSImport_StdCtrls • TPSCustomPlugin
SynEdit TSynEdit • TSynCompletion • TSynAutoComplete • TSynMacroRecorder • TSynExporterHTML • TSynPluginSyncroEdit • TSynPasSyn • TSynFreePascalSyn • TSynCppSyn • TSynJavaSyn • TSynPerlSyn • TSynHTMLSyn • TSynXMLSyn • TSynLFMSyn • TSynDiffSyn • TSynUNIXShellScriptSyn • TSynCssSyn • TSynPHPSyn • TSynTeXSyn • TSynSQLSyn • TSynPythonSyn • TSynVBSyn • TSynAnySyn • TSynMultiSyn • TSynBatSyn • TSynIniSyn • TSynPoSyn
Chart TChart • TListChartSource • TRandomChartSource • TUserDefinedChartSource • TCalculatedChartSource • TDbChartSource • TChartToolset • TChartAxisTransformations • TChartStyles • TChartLegendPanel • TChartNavScrollBar • TChartNavPanel • TIntervalChartSource • TDateTimeIntervalChartSource • TChartListBox • TChartExtentLink • TChartImageList
IPro TIpFileDataProvider • TIpHtmlDataProvider • TIpHttpDataProvider • TIpHtmlPanel
Virtual Controls TVirtualDrawTree • TVirtualStringTree • TVTHeaderPopupMenu