Skip to content

Commit

Permalink
Adapt connect_remotely to pass function names instead of function obj…
Browse files Browse the repository at this point in the history
…ects.
  • Loading branch information
vh-d committed Dec 14, 2019
1 parent 3cbd92d commit 78bb898
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions R/rodbc_multiple.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ odbcConnectAccess <- function(

connect_remotely(
socket,
FUN = RODBC::odbcConnectAccess,
FUN = "odbcConnectAccess",
access.file = access.file,
uid = uid,
pwd = pwd
Expand All @@ -109,13 +109,13 @@ odbcConnectAccess <- function(
#' @param \dots arguments to be passed to \code{FUN}
#' @return odbc32 object
#'
connect_remotely <- function(socket, FUN, ...)
connect_remotely <- function(socket, FUN, ns = "RODBC", ...)
{
arguments <- list(...)

ref <- r2r::eval_remote(
expr = .append_con(do.call(FUN, arguments)),
data = list(FUN = FUN, arguments = arguments),
expr = .append_con(do.call(get(FUN, asNamespace(ns)), arguments)),
data = list(FUN = FUN, ns = ns, arguments = arguments),
socket = socket
)

Expand All @@ -141,7 +141,7 @@ odbcConnectAccess2007 <- function(

connect_remotely(
socket,
FUN = RODBC::odbcConnectAccess2007,
FUN = "odbcConnectAccess2007",
access.file = access.file,
uid = uid,
pwd = pwd
Expand All @@ -163,7 +163,7 @@ odbcConnect <- function(

connect_remotely(
socket,
FUN = RODBC::odbcConnect,
FUN = "odbcConnect",
dsn = dsn,
uid = uid,
pwd = pwd
Expand All @@ -182,7 +182,7 @@ odbcDriverConnect <- function(
# RODBC::odbcDriverConnect()
connect_remotely(
socket,
FUN = RODBC::odbcDriverConnect,
FUN = "odbcDriverConnect",
...
)
}
Expand Down

0 comments on commit 78bb898

Please sign in to comment.