View(df) in R throw (function(x, df1, df2, ncp, log = FALSE))
3
votes
0
answers
1165
views
I connected R with SQL Server (in Visual Studio 2017) the connection succeeded this is Setting.R
settings <- as.environment(list())
dbConnection1 <- 'Driver={SQL Server};Server=
(local);Database=SaVeITDB;Trusted_Connection=yes'
this is SqlQuery.sql also executing the below query succeeded
-- Place SQL query retrieving data for the R stored procedure here
select AOIName from AreaOFInterest a, ProjectsAOI p where p.AOIId = a.AOIId;
and this is Script.R when I executing it throw this function in df file
source("Settings.R")
library(RODBC)
conn <- odbcDriverConnect(connection = dbConnection)
df <- sqlQuery(conn, iconv(paste(readLines('c:/users/comnet/source/repos/rproject3/rproject3/sqlquery.sql', encoding = 'UTF-8', warn = FALSE), collapse = '\n'), from = 'UTF-8', to = 'ASCII', sub = ''))
View(df)
this df file (appears with lock icon)
function(x, df1, df2, ncp, log = FALSE) {
if (missing(ncp))
.Call(C_df, x, df1, df2, log)
else .Call(C_dnf, x, df1, df2, ncp, log)}
**Edit**
It's executing correctly without any error after run Visual studio as admin

Asked by Rand alrand
(45 rep)
Mar 18, 2018, 07:01 PM
Last activity: Mar 20, 2018, 07:47 AM
Last activity: Mar 20, 2018, 07:47 AM