none
Error odbcConnect after sql update RRS feed

  • Question

  • The database which I want to connect to has recently updated SQL Server from 2008 to 2016.
    I was using these lines of code (this is R language using RODBC library) which worked well before the update:

    myconn <- odbcDriverConnect("Driver=ODBC Driver 17 for SQL Server;server=199.___.___.__;database=***;uid=***;pwd= ***")
    city <- sqlFetch(myconn, "RT_CITY_NAMES")

    but now I have this error:

    Error: first argument is not an open RODBC channel. ODBC connection failed
    Calls: source -> withVisible -> eval -> eval -> sqlFetch

    In addition: Warning messages:

    1: In RODBC::odbcDriverConnect("DSN=Driver=ODBC Driver 17 for SQL Server;server=199.___.___.__;database=***;UID=***;PWD= ***") :

      [RODBC] ERROR: state IM012, code 0, message [unixODBC][Driver Manager]DRIVER keyword syntax error

    2: In RODBC::odbcDriverConnect("DSN=Driver=ODBC Driver 17 for SQL Server;server=199.___.___.__;database=***;UID=***;PWD= ***") :

      ODBC connection failed

    Do you know what I need to modify?


    • Edited by JBSc Wednesday, January 15, 2020 10:08 AM
    Wednesday, January 15, 2020 10:08 AM

All replies

  • Try

    Driver={ODBC Driver 17 for SQL Server}


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Wednesday, January 15, 2020 10:19 AM
  • Hi JBSc, 

    Thank you for your issue.

    Sorry that I am not familiar with R language. Please try Erland's advice and maybe you can post your issue  in R language forum to ask for help . 

    Also , there is a similar issue , please check . Argument is not an open RODBC channel

    Best Regards,

    Rachel 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 16, 2020 3:21 AM