Hey there, vb6 automatically open a message box when executing a Store Procedure (recordset.open etc..) but how i catch that error and create a custom one because i cant catch the error with the err.number(-2147217873).

I'm currently using this method to catch unique Key constraint
Code:
        set rsC = rs.clone
        rsC.Requery
        rsC.Filter = "CDMId =" & cboCDMID & " And " & "InsId =" & cboInsID

        If rsC.RecordCount > 0 Then
        Msg "CDMID '" & cboCDMID & "', InsID '" & cboInsID & "'  is already registered", ""
            cboCDMID.SetFocus
            Exit Sub
            Else
                rsN.Open nSelect, CnString, adOpenDynamic, adLockOptimistic
                FColorW
                cboCDMID.SetFocus                
       End If
The problem is that the requery is slow with large data.

How to catch in VB6 an create a custom/friendly Msbox error from a SqlServer/Store Procedure? Thanks