I really doubt there is a solution to this but I'll ask just in case.

Is there a way to keep VB from crashing in the following scenarios?

1. I'm using the API SetParent. When the main form is unloaded it detaches the child form that was previously created. But, if there is an error on the child form and I have to stop the program from the VB interface, the unload code is never executed. This causes VB to crash since the child form wasn't properly detached.

2. I'm using a data environment designer. Some databound controls cause VB to crash depending on the location of the cursor and the cursor type of some record sets.

I am using VB 6 with service pack 5.