none
Unable to establish a DB Connection from R Server remote. Displays error message : "first argument is not an open RODBC channel"

    Question

  • In order to perform some operations in the DB, I have an R Script(Given below) which will connect to a DB which works perfectly fine locally. But when I execute the code in R Server Remote(connected to a remote server). It throws an error message : "Error in odbcGetInfo(myconn) : argument is not an open RODBC channel". 

    R Script:

    *********************************************************************************************

    library(mrsdeploy);

    remoteLogin("http://XYZ:12800", username = "admin", password = "XYZ");

    library(RODBC);

    myconn <- odbcDriverConnect("driver={SQL Server};server=XXXXXXXX;database=YYYYYYYYYYY;trusted_connection=true");
    odbcGetInfo(myconn);

    *********************************************************************************************

    Friday, April 21, 2017 11:22 AM

All replies

  • I think you're running into an issue because your ODBC driver is using "Trusted_Connection=True". When you're connected via a remoteLogin you're no longer running an R process that's authenticated as your Windows login. As a result, the Windows user that's running under the remote login (something low privileged?) isn't able to connect to your database.
    Friday, April 21, 2017 1:57 PM