开发者

Getting "IErrorInfo.GetDescription failed with E_FAIL(0x80004005)" when querying "select * from open"

开发者 https://www.devze.com 2023-02-09 04:30 出处:网络
I have my C# app connected to Jet 4.0 engine. When I run the query \"select * from open\" (I think \"open\" is a keyword and this is why I\'m getting an exception, but...) I 开发者_Python百科get this

I have my C# app connected to Jet 4.0 engine. When I run the query "select * from open" (I think "open" is a keyword and this is why I'm getting an exception, but...) I 开发者_Python百科get this exception: "IErrorInfo.GetDescription failed with E_FAIL(0x80004005)". I usually get more human readable exceptions telling me what is wrong with my query. This one looks more like a bug in the Jet engine. I just tested in Microsoft Access 2002 to run the same query and it treats "open" as a perfectly valid name. I can create a table named "open" and do whatever I want with it. I just need to know if it's a bug in the Jet engine so I can go ahead and replace the weired looking message for a human readable one and show that to the user, or if there is a problem with my code.


I have been through the same problem, try enclosing the reserved word in square brackets i.e.:

"select * from [open]"


I use the below sql in excel:

"select * from [open$]"

Maybe you can try it.

0

精彩评论

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