hi
I am facing a issue related to DAO.DBEngine. In previous VB5.0 application the database related errors are captured by DAO.DBEngine.Errors method.
The code like this,
Friend DAODBEngine_definst As New DAO.DBEngine
If DAODBEngine_definst.Errors(0).Number = 20023 Then
MsgBox("Password matches with one of the prior passwords")
Exit Sub
End If
after upgradation in
VB .Net 2005 we are using Microsoft.Practices.EnterpriseLibrary
for datbase handling.
In new .Net applicaton error handling is done by using Try catch block
so can any one suggest me the replacement code of line "DAODBEngine_definst.Errors(0).Number = 20023 " .
This should be like
catch ex as Exception
If (ex. (some code)= 20023 )then
MsgBox("Password matches with one of the prior passwords")
Exit Sub
End If
End try
ultimately how can i capture the error number in catch block.
can i use Microsoft.VisualBasic.ErrObject to capture error number
Is it working same as DBengine.Error(0).number?
Thanks