RODBC odbcDriverConnect() Connection Error

前端 未结 4 1604
长发绾君心
长发绾君心 2020-11-27 17:09

I\'m trying to use

odbcDriverConnect(\'driver={SQL Server};server=servername\\instancename,port;database=testing;username=abc;password=123456\') 

4条回答
  •  南方客
    南方客 (楼主)
    2020-11-27 17:44

    For the Microsoft ODBC Driver 11 for SQL Server on Linux with RODBC version 1.3-7 in R version 3.0.1 none of the above answers worked. What did work however was the following:

    dbconnection <- odbcDriverConnect("Driver=ODBC Driver 11 for SQL Server;
                    Server=127.0.0.1; Database=MyDBName; 
                    Uid=MyName; Pwd=XXXX")
    

    (put in the relevant IP address, database name etc.).

    In case of a trusted connection:

    dbconnection <- odbcDriverConnect("Driver=ODBC Driver 11 for SQL Server;
                    Server=127.0.0.1; Database=MyDBName; 
                    Uid=MyName; Pwd=XXXX; trusted_connection=yes")
    

    trusted_connection will only listen to "yes" or "no" and not to "true" and "false"

提交回复
热议问题