Errors collection not getting populated on SQL7 exception


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Errors collection not getting populated on SQL7 exception

  1. #1
    Ed Guest

    Errors collection not getting populated on SQL7 exception


    I am executing a SQL 7 stored proc from within an MTS COM object written in
    VB6. When the SP does raiserror (@errMsg,3,111), rs.ActiveConnection.Errors.Count
    = 0.

    If I execute the same SP from an ASP page, ...Count > 0.

    Any thoughts?

    Ed

  2. #2
    Robert Gelb Guest

    Re: Errors collection not getting populated on SQL7 exception

    I maybe wrong and the information I have dates back to vb3, but I believe
    that in order for the SP error to filter back to VB, it must be between
    levels 11-18, thus:

    change raiserror (@errMsg,3,111) to raiserror (@errMsg,11,111)

    --
    Robert Gelb

    "Ed" <edmacdonald@skydive.ca> wrote in message
    news:38d17d90$1@news.devx.com...
    >
    > I am executing a SQL 7 stored proc from within an MTS COM object written

    in
    > VB6. When the SP does raiserror (@errMsg,3,111),

    rs.ActiveConnection.Errors.Count
    > = 0.
    >
    > If I execute the same SP from an ASP page, ...Count > 0.
    >
    > Any thoughts?
    >
    > Ed




  3. #3
    Ed Guest

    Re: Errors collection not getting populated on SQL7 exception


    Thanks,

    I changed to 11 and now the error generates the On Error event within VB.
    But with level 3, the Errors collection should still be populated for soft
    errors and warnings, right? - as it does in VB script.

    Ed


    "Robert Gelb" <robertgelbNOSPAMFORME@zdnetonebox.com> wrote:
    >I maybe wrong and the information I have dates back to vb3, but I believe
    >that in order for the SP error to filter back to VB, it must be between
    >levels 11-18, thus:
    >
    >change raiserror (@errMsg,3,111) to raiserror (@errMsg,11,111)
    >
    >--
    >Robert Gelb
    >
    >"Ed" <edmacdonald@skydive.ca> wrote in message
    >news:38d17d90$1@news.devx.com...
    >>
    >> I am executing a SQL 7 stored proc from within an MTS COM object written

    >in
    >> VB6. When the SP does raiserror (@errMsg,3,111),

    >rs.ActiveConnection.Errors.Count
    >> = 0.
    >>
    >> If I execute the same SP from an ASP page, ...Count > 0.
    >>
    >> Any thoughts?
    >>
    >> Ed

    >
    >



  4. #4
    Ed Guest

    Re: Errors collection not getting populated on SQL7 exception


    Got it, but I don't get it.

    After setting up the ADO objects, if I use rs.Open I don't get any errors
    on the connection object. If I use cmd.Execute, the errors show up.

    Ed


    "Ed" <edmacdonald@skydive.ca> wrote:
    >
    >Thanks,
    >
    >I changed to 11 and now the error generates the On Error event within VB.
    > But with level 3, the Errors collection should still be populated for soft
    >errors and warnings, right? - as it does in VB script.
    >
    >Ed
    >
    >
    >"Robert Gelb" <robertgelbNOSPAMFORME@zdnetonebox.com> wrote:
    >>I maybe wrong and the information I have dates back to vb3, but I believe
    >>that in order for the SP error to filter back to VB, it must be between
    >>levels 11-18, thus:
    >>
    >>change raiserror (@errMsg,3,111) to raiserror (@errMsg,11,111)
    >>
    >>--
    >>Robert Gelb
    >>
    >>"Ed" <edmacdonald@skydive.ca> wrote in message
    >>news:38d17d90$1@news.devx.com...
    >>>
    >>> I am executing a SQL 7 stored proc from within an MTS COM object written

    >>in
    >>> VB6. When the SP does raiserror (@errMsg,3,111),

    >>rs.ActiveConnection.Errors.Count
    >>> = 0.
    >>>
    >>> If I execute the same SP from an ASP page, ...Count > 0.
    >>>
    >>> Any thoughts?
    >>>
    >>> Ed

    >>
    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center