通过 R DBI 程序包连接到 MS SQL 服务器时出现问题

Problems Connecting to MS SQL Server Through R DBI Package

我正在尝试使用 Mac 建立到 SQL 服务器的连接 Microsoft OBDC 驱动程序和 DBI 包。

连接建立,但是字符字段,甚至那些没有特殊字符的字段,return 出现乱码。该数据库是专有的,所以我对我可以显示的实际输出有限制。数字字段 return 没问题。

一些其他笔记。

> dbGetquery(con, "Select name from tb1", n = 1)
Warning: Pending rows
              name
1     CalteMtrSeda

grep("tb1", dbListTables(con), value = TRUE)
character(0)
> con
<OdbcConnection> user@ExpectedDataBase
  Database: NameIWouldExpect
  Microsoft SQL Server Version: 13.00.1742

** 已更新以包含模式。

我得到了所有其他角色 returned。从上面的例子。 CalteMtrSeda == CharlotteMotorSpeedway

这是我第一次尝试从 Mac 连接到此数据库。

原来和R3.6有关。恢复到 R3.5 解决了这个问题。 Link 到 odbc repo

中的相关问题

https://github.com/r-dbi/odbc/issues/283