Too few options trying to connect to a Microsoft Access database in R

I am using RODBC to connect to a Microsoft access database. Some queries work fine, but on one I keep getting errors:

07002 -3010 [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
[RODBC] ERROR: Could not SQLExecDirect 'SELECT baseunit FROM archiverapp_common_units WHERE unitname = "ng/ml"'

I am using the sqlQuery function to query. The SELECT statement specified in the error is what I intend to use, and works when I copy-paste directly into Access. From what I have collected while looking at similar records, this often arises from incorrect spelling of the column or table name, but everything seems to be correct here.

+4
source share
1 answer

- , WHERE. R-

'SELECT baseunit FROM archiverapp_common_units WHERE unitname = "ng/ml"'

"SELECT baseunit FROM archiverapp_common_units WHERE unitname = 'ng/ml'"

.

+5

All Articles