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


  • 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:



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


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


    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