3

I'm trying to connect to a Sybase database (ASE) using the DBI and odbc packages. Using these packages the connection fails. However, when using the same dsn and the RODBC package, the connection does work. What are possible causes of the failure using DBI and odbc? Should I provide additional arguments when connecting to a Sybase server? (See below)

Reproducible example

# 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
)

The error received when using DBI / odbc

Error: nanodbc/nanodbc.cpp:950: 08S01: [DataDirect][ODBC OpenAccess SDK driver][OpenAccess SDK Client]TCP/IP error, connection timed out

My questions

  • Should I provide additional arguments when calling dbConnect to connect to a Sybase server?
  • If so, which ones?
  • If not, what else am I doing wrong? (The dsn works as shown using the RODBC package.)

I've tried to look up extra info here, which seems to suggest I may need extra arguments. But my knowledge in this field is limited, so I'm not sure how to adapt it to the current situation.

Sybase database version

Adaptive Server Enterprise 15.7

Session info

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   
Willem
  • 976
  • 9
  • 24

0 Answers0