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!

Handling SQLDMO errors gracefully in VB6

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 SQLState/native sql error number via some property somewhere in SQLDMO i.e. a parallel to the ADO Error object?

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