Cannot get a specific error code from OleDbConnection when using Client Access Express
- From: "rb" <raleigh5@xxxxxxxxxxx>
- Date: Tue, 06 Jun 2006 22:58:50 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( CA V5R2) 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
.
- Follow-Ups:
- Prev by Date: AS400 network load balancing
- Next by Date: putty and iAccess
- Previous by thread: AS400 network load balancing
- Next by thread: Re: Cannot get a specific error code from OleDbConnection when using Client Access Express
- Index(es):
Relevant Pages
|