Pls Help: IErrorInfo.GetDescription failed with E_FAIL

V

VB Programmer

I am getting a "IErrorInfo.GetDescription failed with E_FAIL" error when
trying to do a "Fill" on a dataadapter. Any ideas?? The SQL command seems
good (to an Access db).

Here is the general function that I am using in a lot of other places
successfully. This is the one that fails on "da.Fill(dt)"...

Public Function GetDataTable(ByVal strSql As String, ByVal strCnnString
As String) As DataTable
Dim cnn As New OleDbConnection(strCnnString)
Try
cnn.Open()

Dim dt As New DataTable
Dim cmd As New OleDbCommand(strSql, cnn)
Dim da As New OleDbDataAdapter(cmd)
da.Fill(dt) ' ***** THIS IS WHERE THE ERROR OCCURS
Return dt
Catch ex As Exception
HandleError(ex)
Finally
If cnn.State = ConnectionState.Open Then
cnn.Close()
End If
End Try
End Function

This is the full error:

"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.System.Data.IDbCommand.ExecuteReader(CommandBehavior
behavior)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand
command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at TropicalIslandCitrus.SqlHelper.GetDataTable(String strSql, String
strCnnString) in
c:\inetpub\wwwroot\TropicalIslandCitrus\Components\SQLHelper.vb:line 27"

Any help would be appreciated. Thanks!
 
V

VB Programmer

I figured it out. A field in my db was called "Size". I think that is
messing it up. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top