Hi All,
I'm strugling to develop an error handling solution and need some advice.
VB6 app I've been asked to enhance have a module that basically gets a recordset from DB, loops and adds data to a treeview nodes.
Backend data is not very clean as it comes from differents sources (import, 3rd party vendor apps). Errors are handled but it's an issue as this procedure is also called as a refresh through timer, so user gets pop-up messages quite often.
I've been asked to remove that and just add all errors to a new "Errors" node. Code needs to resume execution until all records are processed.
I added the following structure, but I get only first record added during my test and then it stops. Any suggestions? Thanks.
Code:
'-- Get recordset here
Do Until rs.EOF
[highlight #FF99FF]On Error GoTo ErrAddToTree[/highlight]
'-- add regular records to treeview nodes here
'-- raise an error for testing
Err.raise 16,"Test","Test"
'-- label to resume execution
[highlight]ResumeExecution:[/highlight]
rs.MoveNext
Loop
Exit Sub
'-- add record's data to "Errors" node and resume execution
[highlight #FF99FF]ErrAddToTree:[/highlight]
Set nodTemp = tvwIncd.Nodes.Add("Errors", tvwChild,intNextAlert, strErrTemp, _
"INCD", "INCDSELECTED")
nodTemp.Tag = lngErrAlertID
[highlight]GoTo ResumeExecution[/highlight]