Search code examples
c#visual-studio-2010ms-accessoledboledbexception

OleDbException Was Unhandled: Error in Displaying Information from Database


I'm new creating applications using Visual Studio 2010 and Microsoft Access 2007. I already created forms and it runs smoothly without getting any errors. However, one of the forms is having trouble in displaying the information I want to display. All of the created forms have the same functions but then this one form is not functioning well.

This is the screenshot of the form that is not functioning: enter image description here

Screenshot of the error message: enter image description here

Please help. Thanks.


Solution

  • For an Access database, that particular error (IErrorInfo.GetDescription failed with E_FAIL 0x80004005) generally means that you are trying to access a field or table that doesn't exist or is a keyword.

    I suspect that the error may be the position field. If you surround all of your field names with brackets, the error will go away if it was a keyword conflict:

    SELECT [position_code], [position_description] FROM [position]