Access VBA: Syntax error on WHERE clause, possible type conflict?
I'm trying to run this piece of code:
strSQL = "SELECT * FROM ORDER_DATA WHERE ORDER=" & curOrder
Set rst_orderData = db.OpenRecordset(strSQL)
The ORDER column from ORDER_DATA is a double开发者_StackOverflow社区 number type, and curOrder is of type double as well.
The error I'm getting points to the second line and says "Syntax error on WHERE clause".
Why do you think this is? Is it a possible type conflict?
Any help is appreciated! Thank you!
ORDER
is reserved word, as in ORDER BY
. You have to put it in brackets.
strSQL = "SELECT * FROM ORDER_DATA WHERE [ORDER]=" & curOrder
精彩评论