By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,264 Members | 1,079 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,264 IT Pros & Developers. It's quick & easy.

Error handling for vb6.0

P: 1
I want to insert error handler part for my new program but I don't know how to insert err.numbers for my new part. And what are the err.numbers and descriptions I can insert for this?

My coding is.......
Expand|Select|Wrap|Line Numbers
  1. Public Function MessageShow(err As ErrObject)
  2.  
  3.     If err.Number = -2147467259 Then
  4.         MsgBox "NO NETWORK CONNECTION"
  5.     ElseIf err.Number = 424 Then
  6.     MsgBox "A missing object in your form is needed!, Please refer to the code  and arrange accordingly!"
  7.     elseif.......
  8.     elseif.......
  9.     elseif.......   ???????
  10.  
  11.     Else
  12.         MsgBox err.Description
  13.     End If
  14.  
  15. End Function
Jan 17 '08 #1
Share this Question
Share on Google+
3 Replies


epots9
Expert 100+
P: 1,351
Moved to the Visual Basic Forums where the resident experts can better assist you.

**Moved from Programming Challenges
Jan 17 '08 #2

Expert 5K+
P: 8,434
Look up "trappable errors" in the documentation.
Jan 18 '08 #3

debasisdas
Expert 5K+
P: 8,127
Try to use
Expand|Select|Wrap|Line Numbers
  1. On Error GoTo ErrorHandler
  2. ...........
  3. ..........
  4. ...........
  5. Exit Sub
  6.  
  7. ErrorHandler:
  8. ...................
Jan 18 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.