Click to See Complete Forum and Search --> : MS access(2003) - IErrorInfo.GetDescription failed with E_FAIL(0x80004005)


JeI-Paradigm
April 4th, 2007, 06:06 AM
Hi gurus!

variables used...

sourceID is an int32 and is always > 0
GPO is a string and is never nothing or ""


"SELECT Client.[Client ID], Client.[Client Name], Client.[Firstname], Client.[Lastname], Client.[Email], Client.[Type], Client.[Status] FROM Client where Client.[Source ID] = " & SourceID & " and Client.[GPO] like '" & GPO & "'"



i get this error when i run this code to SELECT


System.Data.OleDb.OleDbException: IErrorInfo.GetDescription failed with E_FAIL(0x80004005).
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.OleDb.OleDbCommand.ExecuteReader()
at Claims_Management_System.ClientFunctions.FetchClientsByGPO(Int32 SourceID, String GPO) in E:\MotorClaims\Claims Management System\Clients\ClientFunctions.vb:line 418


i have no clue what this means, but when i google it i get a bunch of forum replies saying its a keyword problem and i should use [] to eliminate it. I am and still i get the error.

I am sure that GPO is the keyword causing this error.

i could change the field name as the other forums suggest but that would mean finding and changing about 25 occurrences of these 3 letters.

I would like to know how i can insert and update using this GPO "keyword" but not select in this statement since i am saying like.

I can select it if i do not place a like or a "=" in the statement.

WHY WHY WHY!

Thanks
J!

olivthill
April 4th, 2007, 07:50 AM
sourceID is an int32It should be a string of characters, because the SQL statement itself is nothing else but a long string of characters, and not a compound of characters and integers and other things.

JeI-Paradigm
April 4th, 2007, 08:32 AM
i use this format throughout the application and there are no problems so far. when inserting or updating i use parametized queries as well as long select statements.

the problem is not the syntax

I changed the field you see GPO to G-P-O and it works fine. now all i gta do is change it everywhere from GPO to G-P-O. what a mission.
would be simpler if i could just say skip the error and select the rows access!

But alas it is never that easy, it is always easier
This is a stupid error message, thought my code was wrong but it turns out its just an access exception.

It works now but thanks for the input!
Later
J!