Re: ADO error trapping not working

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Franck" <the_darkblast@xxxxxxxxxxx> wrote in message
news:1145976990.793089.293430@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Actually his code doesnt work for me either but first of all
case -5000 mean : (Variable Case) minus 5000
i just change to this and it actually work for me

case clng("-214746259")

and even

case "-214746259"

the second one work if you havent use the explicit option :P


Enclosing the number in quotes makes it a string. It will not match with
Err.Number, unless you convert the number to a string. I originally tested
with the following VBScript snippet:

On Error Resume Next
Err.Raise -214746259

Select Case Err.Number
Case -214746259
Wscript.Echo "Match"
Case Else
Wscript.Echo "Else"
End Select
On Error GoTo 0

This convinced me the syntax is correct, as I got the message "Match". The
code should work as long as the error has not been cleared, there is an On
Error statement, and everything is in one method/sub/program. We don't see
in the code fragment originally posted how the error is raised or how we get
to the Case statement.

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net


.



Relevant Pages

  • Re: VBA range selection question
    ... I am going to have to learn not to rely so heavily on my past experience with the compiled version of VB when trying to develop optimized solutions for Excel's VBA. ... it depends on whether you are asking about the code fragment ... both of our implementations are not as optimal as they could ... String implementation. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: VBA range selection question
    ... it depends on whether you are asking about the code fragment ... both of our implementations are not as optimal as they could ... String implementation. ... Answers Forum also implementated VBA Byte operations. ...
    (microsoft.public.excel.worksheet.functions)
  • Eventlog application registration error
    ... security error. ... Here's the code fragment that's causing the error: ... Dim source As String = "Report Request Confirmation" ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: regex result question
    ... It did capture the date string ... my actual code fragment for the pattern is like the attached txt file ...
    (microsoft.public.dotnet.languages.vb)