VBA Command don't recognize Error Trapping



Hi all.

I'm developing a VBA vs. SQL Server 2000 application , and I have a problem
with some Stored Procedures.

All SPs have their own Error Trapping, so if there's an error during the
execution, we have a VB validation reading Output parameters in order to
caught backend errors and proceed in consecuence.

My problem is that some procedures, fails in the .execute statement (VB
code) and execution goes directly to VB Error Trapping code, (instead
continue the flow, to the standard Back End error trapping we have
implemented, as the rest of procedures).

There is an example to make process more understandable:


Private Sub ..... ( )

On error goto error...

Declare and initialize variables
Open command
Edit command
.execute (HERE, SP FAILS)
Custom Error Trapping code (Most of SPs executes this code when they
fails)
Read Output Parameters
If @@ERROR <> 0
Perform needed actions
Close and deallocate command

Exit:
End
Error: (THE WRONG SPs COMES DIRECTLY HERE)
action1
action 2
goto exit


I'm looking for difference between procedures which are correctly trapped
and don't, but I found nothing weird.

Any idea?

Thanks in advance.


.