Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Madeline Ross   on Nov 09 In MS Office Category.

  
Question Answered By: Erika Evans   on Nov 09

Once you've engaged the On error  Resume Next mechanism, you can easily test
for success or failure by checking the status of the Err object. If it's
anything other than 0, something unexpected happened. I typically use the
FileSystemObject to hold an error log  open for quick updates with these
errors. After you've recorded the error, reset the Err object's value to 0
by using the Clear method. Quickie sample:

On Error Resume Next

YourData="Your Data"
YourSQLObject.YourRecordAddMethod YourData
If Err <> 0 Then
'gather the errors and send them to your log routine
LogError "Error: " & Err.Number & ", " & Err.Description & _
", Data: " & CStr(YourData)
Err.Clear
End If

'When you've finished all your work, set
'the Error object back to it's natural state
On Error GoTo 0

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Error log for non inserted records? Or get search suggestion and latest updates.


Tagged: