我正在尝试使用odbc通过R将本地SQL服务器/数据库连接到Power BI。
我一直在网上寻找许多话题,以寻求解决方案。其他人遇到了我的问题,但是他们提供的解决方案对我不起作用。我敢肯定这很简单,我无法理解。
ch <- odbcDriverConnect(
"Driver={SQL Server};Server=localhost;Database=deliverydashboard;Trusted_Connection=TRUE"
)
这些是我收到的错误消息:
1: In odbcDriverConnect("Driver={SQL Server};Server=localhost;Database=deliverydashboard;Trusted_Connection=TRUE") :
[RODBC] ERROR: state 08001, code 17, message [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.
2: In odbcDriverConnect("Driver={SQL Server};Server=localhost;Database=deliverydashboard;Trusted_Connection=TRUE") :
[RODBC] ERROR: state 01000, code 2, message [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()).
3: In odbcDriverConnect("Driver={SQL Server};Server=localhost;Database=deliverydashboard;Trusted_Connection=TRUE") :
ODBC connection failed
Error in sqlQuery(ch, "DROP TABLE deliveryexpensebackend") :
first argument is not an open RODBC channel
Execution halted