Acessing the SQL Error code within a DAL exception


Author
Message
Peter Jones
Peter Jones
Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi,

I want to wrap certain database processing in Try blocks, check any error and retry (within limits) if they are expected, e.g. locking. However, I'm having trouble identifying the native SQL error code within the Exception, e.g.

blTry = True
While blTry
   Try
      Me.FillByStoredProcedure(StoredProc)
      blTry = False
   Catch ex As Exception
      blTry = CheckTheError(ex)
   End Try
End While

I can see the SQL Error Description but I want to evalute errors using native SQL error codes.

Cheers, Peter

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search