Thursday, April 23, 2009

Using "Zone" as a field alias in SQL query generates getDescription error 80004005

Spent a few minutes on this one and it seemed worth noting. I was trying to run a query joining a few tables using field aliases (e.g. tbl_X.fieldY AS aliasZ) because each table has an fName field that I need to reference.

The query generated an error: IErrorInfo.GetDescription failed with E_FAIL(0x80004005)

At first I thought it as a DCOM permissions issue, since error code 80004005 can indicate an insufficient security permissions when accessing resources using COM. However, it turns out my alias tbl_Zone.fName as Zone" was the problem.

Apparently Zone is a reserved word in this context? Who knew.

No comments: