What is causing my OLEDbException, IErrorInfo.GetDescription failed with E_FAIL(0x80004005)

后端 未结 3 1970
心在旅途
心在旅途 2020-12-06 10:53

I am using an OleDbConnection, OldDbCommand, and OleDbReader against an Access database.

I have a named query in the database which I am calling from the code.

3条回答
  •  天涯浪人
    2020-12-06 11:32

    ..and have wrapped all column names in brackets anyway to rule it out.

    Not only columns names that should be surrounded by square brackets Table names should as well For example, replace the below line

    SELECT id FROM table1 WHERE id = 5
    

    With the below line

    SELECT [id] FROM [table1] WHERE [id] = 5
    

提交回复
热议问题