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

后端 未结 3 1965
心在旅途
心在旅途 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:31

    I apparently was mistaken when I said the query did not contain any reserved words.

    The query I was using was selecting from another query in the Access Database. That other query had a reserved keyword that was causing the problem.

    BTW:

    The Access database engine runs in different modes, depending on whether it is called from Access, data access objects, the Microsoft OLE Provider for the Access database engine, or the Microsoft Access ODBC driver. It can be run in either ANSI mode or non-ANSI (traditional) mode.

    Because using these two modes results in two slightly different sets of reserved words, a query that uses a reserved word might work in one mode and fail in another mode

    Access 2007 reserved words and symbols

    Keith

提交回复
热议问题