Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I intercept SQL Server's native error using SQLDMO?

Status
Not open for further replies.

cnicho

Programmer
Jan 9, 2003
7
GB
Hi
I would like to intercept a login failure and display a message accordingly.

I am using SQLDMO in VB6. The ServerMessage event does not process messages with a severity higher than 10 so the procedures error handler processes it as a vb error.

The Err.Number is a large negative number and the Err.Source property value contains the generic ODBC error 28000.

Is it possible to read the native sql error number via some property somewhere in SQLDMO i.e. an equivalent to the ADO Error object's NativeError property?

Or can the large negative number returned in the Err.Number property be translated into something meaningful?

Regards
Craig
 
I found the answer buried in an MSDN article.
You subtract vbObjectError constant from the Err.Number value.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top