Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i'm using a standard ms access 2000 and 2002-2003 mdb file.
When I debug a system using by VB.NET and run the DataAdapter, i get the following message
The error box title is "OleDBException was unhandled"
and under the error box is
"IErrorInfo.GetDescription failed with E_FAIL(0x80004005)"

My system is link to ms access.

The following is my part of the system code(error code):
Dim sql As String = "Select Options From USERDT Where USERID='" + Label2.Text + "' AND Module='TAS' AND FormName='Staff'"
        Dim cmd As New OleDbCommand(sql, connect)
        dSet.Reset()
        dAdapter.SelectCommand = cmd
        dAdapter.Fill(dSet) '''this part getting error(IErrorInfo.GetDescription failed with E_FAIL(0x80004005))
        If dSet.Tables(0).Rows(0).Item("Options") = "N" Then
            MsgBox("Access Deny!")
        ElseIf dSet.Tables(0).Rows(0).Item("Options") = "R" Or dSet.Tables(0).Rows(0).Item("Options") = "W" Then
            Form12.Show()
        End If


What is the problem? There is no reserved words, I has change all the reserved words.
Please help.

Thanks in advance.
Posted
Updated 11-Jul-18 17:29pm
v3
Comments
virusstorm 13-Aug-13 15:59pm    
See if this helps:
http://forums.asp.net/t/1225443.aspx

I think some of your column names may be reserved words in Access.
Adrian4263 14-Aug-13 4:01am    
Thanks your reply,but it doesn't work for me.
I check many times already,there is no reserved words in my Ms Access database.

Please, read virusstorm's comment to the question and and this post: IErrorInfo.GetDescription failed with E_FAIL(0x80004005)- What does this error means?[^]. Do not use reserved words[^] or put the square brackets [] around the field name or table name, ie:
VB
Dim sql As String = "SELECT [Options] FROM [USERDT] WHERE [USERID]='" & Label2.Text & "' AND Module='TAS' AND FormName='Staff'"


Note: use & to concatenate a string in VB.NET. + is usually used to add numbers. See this: Concatenation Operators in Visual Basic[^]
 
Share this answer
 
Comments
Adrian4263 17-Aug-13 3:39am    
I've checked,there is no reserved words, and I've tried your above method.It doesn't work for me also. Still have any solution?Anyway thanks for your reply.
Maciej Los 18-Aug-13 16:21pm    
USERID is numeric? If so,

Dim sql As String = "SELECT [Options] FROM [USERDT] WHERE [USERID]='" & Trim(Str(Label2.Text)) & "' AND Module='TAS' AND FormName='Staff'"


Does that work?
 
Share this answer
 
Sql = "SELECT * FROM Sheet3 WHERE Category LIKE 'OBC%'"

Be Sure That Your Write Field Name Correct. No Space And No Symbol Only Underscore
 
Share this answer
 
v2
Your problem is with the word OPTION. Change it to a different field name and it will work
 
Share this answer
 
Comments
CHill60 25-Nov-15 5:57am    
The OP does not have a field called "Option" - it is "Options" (which is not actually listed as a reserved word).
The concept of avoiding reserved words has already been discussed and an alternative (square brackets) already suggested - over a year and a half ago.
Your solution adds nothing to the solutions already posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900