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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error handling from Access

Status
Not open for further replies.

pldelosrios

Programmer
Jun 24, 2001
14
ES
I access to a SQL Server 2000 database from an Access 97 aplication.
I'm not able to make an error-handling program that works fine.

I can't catch the Error number. I get the same error code even if i try to delete or to
add a record. I looked the Errors collection, but...

 
Which errors collection are you using? If you are using the Err object, you should be able to get the error number with "Err.number" (assuming you used "On Error Resume Next" or an equivalent)

If you are not getting an error number through that, you might try this:

Private cnn as New ADODB.Connection
On Error Resume Next
With cnn
.Errors.Clear
.Open "SomeDSNorSomething"
msgbox .Errors(.Errors.Count - 1).Number
End With

If this doesn't help you, please give more details.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top