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
  • Thanks Bob, Fixed the issue.

    Tuesday, May 02, 2017 9:51 AM
  • They way Ram fixed the issue is by going to 'Services' and changed the owner of the process i.e. to make RServer 9.0.0 service to run under same user as that of windows. This same user has full access to DB and as they are running on same user credentials it worked.

    satyaganti

    • Proposed as answer by Satyaganti Friday, May 12, 2017 8:47 AM
    Friday, May 12, 2017 8:47 AM