Cannot determine a specific error code using OleDbConnection with Client Access Express
- From: "rb" <raleigh5@xxxxxxxxxxx>
- Date: Mon, 05 Jun 2006 17:57:25 GMT
using VS.Net2003 and code is in Visual Basic. i am having trouoble getting
specific sql error values/descriptions. i am using a
System.Data.OleDb.OleDbConnection object which accesses an iSeries / As-400
database via IBM Client Acces Express connection. the value for Provider =
IBMDA400.DataSource.1. and the value for Transport Product = Client
Access.
i use a System.Data.OleDb.OleDbCommand object to ".ExecuteNonQuery" to
INSERT or UPDATE tables on the iSeries. Works fine. But, if i create an
error condition, such as attempting to INSERT a duplicate value or perhaps
some invalid syntax in the SQL, the only error code returned is -2147467259
.... which is a generic return code. i am uncertain as to if this is
something i am doing wrong, or if it is a known issue with Client Access
Express or maybe something else. anybody?
example of Try-Catch -Finally code:
Try
cmdBIMS.CommandText = sSQL
nRowsAffected = cmdBIMS.ExecuteNonQuery()
Catch ex As OleDb.OleDbException
' BOTH the following return the value -2147467259
s = ex.Errors.Item(0).SQLState
s &= "Code: " & ex.ErrorCode
s &= " Source: " & ex.Source
DisplayAppMessage("WriteVendorLotTxnToBIMS", s)
Catch ex As Exception
s = "Error: " & ex.Message
DisplayAppMessage("WriteVendorLotTxnToBIMS", s)
Finally
' anything??
End Try
.
- Prev by Date: Re: File/record locking
- Next by Date: MTA with thread pool API
- Previous by thread: Re: SQLConnection still working after KILL the SQL process
- Next by thread: MTA with thread pool API
- Index(es):
Relevant Pages
|
|