I have a brilliant R application that runs locally, but when I download it, I get an error message:
first argument is not an open RODBC channel
Here is my code:
conn<- suppressWarnings( odbcDriverConnect('driver={SQL Server};server=SWDCH; database=GR; trusted_connection=yes;uid=RUser , pwd=ruser'))
data <- sqlQuery(conn,paste("exec Performance @MetricType = '", MetricType ,"',@Metric = '", Metric ,"', @Market = '", Market , "', @StartDate = '", StartDate, "', @EndDate = '", EndDate, "';",sep =""),errors=FALSE)
I think the problem is with the conn object, but any idea what the problem is?
source
share