really stuck on ExecuteReader

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
I am using
VisualStudio2003,
Access2003
Vb.Net and ADO.Net for db access.

I get this message when i try to use ExecuteReader method :
IErrorInfo: GetDescription failed with E_FAIL( some hexvalue )

E_FAIL turns out is general failure of some component( accroding to msdn )

Now i tried MSDN it says GetDescription supposed to return description of
error that is generated by database.

This is what I am doing:

I have a table called section


g_AdoCon = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" + db)
//checked the db variable, it is valid path and everything and this
// conenction works in another class fine

If g_AdoCon.State = ConnectionState.Closed Then
g_AdoCon.Open()
End If
m_Command = New OleDbCommand
m_Command.Connection = g_AdoCon


query = "Select * from section where cls_id = 3"
m_Command.CommandText = Query

m_Reader = m_Command.ExecuteReader(CommandBehavior.CloseConnection)

the exception is raised when m_Command.ExecuteReader is executed.


Am really stuck on this, sionce MSDN didn't really help and i have no idea
what that exception means.

Pleas help!
 
Be sure to add a Try/Catch exception handler around the code to trap the
exception.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
arrr, i knwo the E_fail thing only because of the try catch blocks.

I mean it's all trapped in try catches , that how i egt that ewrror message
in a message box. The program proceeds after that fine except for no data
pulled out of table.
 
If theres not a problem with the connection string, try changing your sql to
"select * from section" and see what happens.

Ron
 
But i changed the select statement tos oem other statement int eh same database
I changed it to select * from class"
This works without a problem??
Am really confused here!!!
 
Hmm, I renamed the table to Sections and everyhting works fine without a
hitch!!!!

Anybody have any suggestiosn what's wrong in having a table called section.
 
Back
Top