dbReadtable not working

I connected to a db using the below code

postab <- dbConnect(odbc::odbc(),
Server = "xxxxx",
Database = "postab",
UID = "dummy",
PWD = "dummy",
Driver="SQL Server"
)
I am trying to read the data the table using dbReadTable

Studentlist <-dbReadTable(postab,"view_name")

the data that I am read is a view in the database.

but I am getting this error.
Error in result_fetch(res@ptr, n) :
nanodbc/nanodbc.cpp:2966: 07009: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
Warning message:
In dbClearResult(rs) : Result already cleared

I don't understand this error. Tried looking for it but didn't understand.

I think it used to work but not working now. The version that I am using right is R 4.0.

Thank You,

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.