Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(odbc)
- library(DBI)
- # dbListTables in a function: gives a warning message
- dbListTablesTest <- function(dsn, userName, password){
- con <- dbConnect(
- odbc::odbc(),
- dsn = dsn,
- UID = userName,
- PWD = password,
- Port = 1433,
- encoding = "latin1"
- )
- availableTables <- dbListTables(con)
- }
- availableTables <-
- dbListTablesTest(
- dsn = "myDsn"
- ,userName = myLogin
- ,password = myPassword
- )
- # dbListTables not within a function works fine (no warnings)
- con2 <- dbConnect(
- odbc::odbc(),
- dsn = "myDsn",
- UID = myLogin,
- PWD = myPassword,
- Port = 1433,
- encoding = "latin1"
- )
- availableTables <- dbListTables(con2)
- warning messages from top-level task callback '1'
- Warning message:
- Could not notify connection observer. trying to get slot "info" from an object of a basic class ("character") with no slots
- 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] 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement