开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜