MS Access, Named parameters and Column Names

后端 未结 2 1559
我寻月下人不归
我寻月下人不归 2020-12-12 02:49

I have the following query which I am executing on an Access database. The query, when run in Access returns accurate results. However when run from the code I get back all

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-12 03:31

    try to edit the query string directly with the desired parameters. Simple example (output query string):

    "SELECT t001_clients.cli_id as id, t001_clients.cli_name WHERE (id = 1);"

    Isn't the pretiest way but would work. Be care about the type characters on parameters ("cli_name = 'John Smith'" or "cli_birthday = #12/27/1980#")

    Also, why did not you use linq queryes? Should be easier...

提交回复
热议问题