R 无法连接到Sybase数据库,是否需要其他参数?
我正在尝试使用R 无法连接到Sybase数据库,是否需要其他参数?,r,odbc,sybase,r-dbi,R,Odbc,Sybase,R Dbi,我正在尝试使用DBI和odbc包连接到Sybase数据库(ASE)。使用这些包,连接将失败。但是,当使用相同的dsn和RODBC软件包时,连接不起作用。使用DBI和odbc时出现故障的可能原因是什么?连接到Sybase服务器时是否应提供其他参数?(见下文) 可复制示例 # Attempt 1 using DBI and odbc fails library(odbc) library(DBI) con <- dbConnect( odbc::odbc(), dsn = myDs
DBI
和odbc
包连接到Sybase数据库(ASE)。使用这些包,连接将失败。但是,当使用相同的dsn和RODBC
软件包时,连接不起作用。使用DBI
和odbc
时出现故障的可能原因是什么?连接到Sybase服务器时是否应提供其他参数?(见下文)
可复制示例
# Attempt 1 using DBI and odbc fails
library(odbc)
library(DBI)
con <- dbConnect(
odbc::odbc(),
dsn = myDsn,
UID = myLogin,
PWD = myPassword,
Port = port
)
# Attempt 2 using RODBC succeeds
library(RODBC)
con2 <- odbcConnect(
dsn = myDsn,
uid = myLogin,
pwd = myPassword,
believeNRows = FALSE
)
我的问题
- 调用dbConnect连接到Sybase服务器时,是否应该提供其他参数
- 如果有,哪些
- 如果没有,我还做错了什么?(dsn使用
包工作如图所示。)RODBC
R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=Dutch_Belgium.1252 LC_CTYPE=Dutch_Belgium.1252 LC_MONETARY=Dutch_Belgium.1252 LC_NUMERIC=C LC_TIME=Dutch_Belgium.1252
attached base packages:
[1] stats graphics grDevices utils datasets tools methods base
other attached packages:
[1] RODBC_1.3-15 DBI_0.7 odbc_1.1.3
loaded via a namespace (and not attached):
[1] bit_1.1-12 compiler_3.4.2 hms_0.3 tibble_1.3.4 Rcpp_0.12.13 bit64_0.9-7 blob_1.1.0 rlang_0.1.2
R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=Dutch_Belgium.1252 LC_CTYPE=Dutch_Belgium.1252 LC_MONETARY=Dutch_Belgium.1252 LC_NUMERIC=C LC_TIME=Dutch_Belgium.1252
attached base packages:
[1] stats graphics grDevices utils datasets tools methods base
other attached packages:
[1] RODBC_1.3-15 DBI_0.7 odbc_1.1.3
loaded via a namespace (and not attached):
[1] bit_1.1-12 compiler_3.4.2 hms_0.3 tibble_1.3.4 Rcpp_0.12.13 bit64_0.9-7 blob_1.1.0 rlang_0.1.2