TSQLDBLibraryLoader/zh CN: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: TSQLDBLibraryLoader/zh CN
| Old | New | Line | |
|---|---|---|---|
| 1 | + | 此控件就是来解决 mysql sqlite3 这些数据库的dll文件引用问题 | |
| 2 | + | ||
| 3 | + | > **Warning:** 本页内容为草稿,最终方案未确定,但可使用,最终方案请看Michael Van Canneyt的官方公告,此页后续有时间更新 | |
| 4 | + | ||
| 5 | + | **TSQLDBLibraryLoader**  是用来确定 Lazarus 和 FPC 应该从哪里加载数据库程序对应的 (DLLs/.sos/.dylibs) 这些文件. TSQLDBLibraryLoader 控件在 [[SQLdb tab]] 的 [[Component Palette]]. | |
| 6 | + | ||
| 7 | + | ## 使用和替代 | |
| 8 | + | ||
| 9 | + | SQLDB数据库连接控件, 最新版本的会加载一些默认库信息, 但也有可能会出错. 使用 SQLDBLibraryLoader 控件可以自定义库文件的详细位置. | |
| 10 | + | ||
| 11 | + | SQLDBLibraryLoader 必须在 TSQLConnection 控件加载或者启用之前调用并配置. | |
| 12 | + | ||
| 13 | + | 【Google翻译机翻】提示: 通常可以通过为使用的TSQLConnection后代设置库名称来执行类似的操作. 这确实取决于支持该功能的TSQLConnection后代. | |
| 14 | + | ||
| 15 | + | > **Note:** 在FPC干线(2.7.1)中添加了对将SQlite与SQLDBLibraryLoader一起使用的支持,并且在早期FPC版本中不可用。 可能的选择:单元sqlite3dyn中的InitializeSQLite函数。 \`\`如果经过测试,请删除此文本。'' | |
| 16 | + | ||
| 17 | + | ## 代码示例 | |
| 18 | + | ||
| 19 | + | ``` pascal | |
| 20 | + | SQLDBLibraryLoader1.ConnectionType:='SQLite3'; | |
| 21 | + | // 注意: .ConnectionType 会重置 LibraryName, 因此需要在后面设置LibraryName以及ConnectionType。 | |
| 22 | + | SQLDBLibraryLoader1.LibraryName := 'c:\path_to_sqllite_library\sqlite3.dll'; | |
| 23 | + | SQLDBLibraryLoader1.Enabled := true; | |
| 24 | + | SQLDBLibraryLoader1.LoadLibrary; | |
| 25 | + | ``` | |
| 26 | + | ||
| 27 | + | ## 参考资料 | |
| 28 | + | ||
| 29 | + | - [[TSQLConnector]] | |
| 30 | + | ||
| 31 | + | --- | |
| 32 | + | *From the Free Pascal wiki, page "TSQLDBLibraryLoader/zh CN", as it stood on 2020-05-16 after a change by TyphonFinger, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
