Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Err.Raise and Error.Raise in VB6

Tags:

difference

vb6

I am supporting an old VB6 application and I wonder why the code uses both Err.Raise and Error.Raise. Both appear in the validations after each database call.

We are migrating this application to C#, and I'm trying to understand the subtle difference between these statements in order to correctly reproduce the both behaviors in C#.

I spent quite a few hours searching for information on Error.Raise, and did not find anything useful.

Thanks,

Yves

like image 725
Yves Forget Avatar asked Oct 19 '25 02:10

Yves Forget


1 Answers

@Marc was right. Error.Raise is just wrong.

Calling "Error.Raise 1234" within the scope of an On Error Goto statement will branch to the error block with Err.number = 424 and Err.Description = "Object required".

The solution becomes obvious : replace Error.Raise by Err.Raise everywhere.

like image 150
Yves Forget Avatar answered Oct 22 '25 05:10

Yves Forget



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!