Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 无法连接到Sybase数据库,是否需要其他参数?_R_Odbc_Sybase_R Dbi - Fatal编程技术网

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
    包工作如图所示。)
我试图查找额外的信息,这似乎表明我可能需要额外的参数。但是我在这个领域的知识有限,所以我不知道如何使它适应当前的形势

Sybase数据库版本

自适应服务器企业版15.7

会话信息

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