如何使用 UTF-8 编码的 SQLite ODBC 驱动程序?
How to use SQLite ODBC Driver with UTF-8 encoding?
我从 http://ch-werner.de/sqliteodbc/ 下载并安装了 SQLite ODBC 驱动程序。
我的列表中有三个新的 ODBC 驱动程序
SQLite (UTF-8) Driver
SQLite ODBC Driver
SQLite3 ODBC Driver
使用 SQLite3 ODBC 驱动程序工作得很好。但不适用于 UTF-8。
我认为在这种情况下可以工作的 SQLite ODBC (UTF-8) 驱动程序只是给我错误消息
Fehler beim Herstellen der Verbindung zur Datenquelle test
IM002 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Fehler beim Herstellen der Verbindung zur Datenquelle: test
英文翻译:
Error connecting to data source test
IM002 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Error connecting to data source test
我做错了什么?
SQLite 驱动程序的提供者 Christian Werner 通过电子邮件帮助了我。
事实证明,在 SQLite3 ODBC 驱动程序的设置中,必须打开 OEMCP Translation
(通过单击 ODBC 数据源管理器中特定用户 DSN 的配置...)
现在所有字符都按预期显示了。
在连接字符串中,这转换为 OEMCPTranslation 参数:
connStr="DRIVER={{SQLite3 ODBC Driver}};Database=<path>;<strong>OEMCPTranslation</strong>=1";
今天,在我的案例中,{...} 有效,但 {{..}} 使用 VBA 将表从 Access 数据库复制到 SQLite 数据库时无效:
DoCmd.TransferDatabase acExport, "ODBC Database", _
"ODBC;DRIVER={SQLite3 ODBC Driver};Database=<path>;OEMCPTranslation=1;", _
acTable, <source table>, <destination table>
我从 http://ch-werner.de/sqliteodbc/ 下载并安装了 SQLite ODBC 驱动程序。 我的列表中有三个新的 ODBC 驱动程序
SQLite (UTF-8) Driver
SQLite ODBC Driver
SQLite3 ODBC Driver
使用 SQLite3 ODBC 驱动程序工作得很好。但不适用于 UTF-8。
我认为在这种情况下可以工作的 SQLite ODBC (UTF-8) 驱动程序只是给我错误消息
Fehler beim Herstellen der Verbindung zur Datenquelle test
IM002 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Fehler beim Herstellen der Verbindung zur Datenquelle: test
英文翻译:
Error connecting to data source test
IM002 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Error connecting to data source test
我做错了什么?
SQLite 驱动程序的提供者 Christian Werner 通过电子邮件帮助了我。
事实证明,在 SQLite3 ODBC 驱动程序的设置中,必须打开 OEMCP Translation
(通过单击 ODBC 数据源管理器中特定用户 DSN 的配置...)
现在所有字符都按预期显示了。
在连接字符串中,这转换为 OEMCPTranslation 参数:
connStr="DRIVER={{SQLite3 ODBC Driver}};Database=<path>;<strong>OEMCPTranslation</strong>=1";
今天,在我的案例中,{...} 有效,但 {{..}} 使用 VBA 将表从 Access 数据库复制到 SQLite 数据库时无效:
DoCmd.TransferDatabase acExport, "ODBC Database", _
"ODBC;DRIVER={SQLite3 ODBC Driver};Database=<path>;OEMCPTranslation=1;", _
acTable, <source table>, <destination table>