Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    7

    Unanswered: What is the correct position re. ADO errors

    I have conflicting statements from MSDN re. ADO errors ffrom the underlying provider in Visual Basic:
    1. Error objects are added to the Errors collection on an error from the underlying provider but no error is raised in VB
    2. Error objects are added to the Errors collection on an error from the underlying provider and an error is raised in VB also

    what is the correct position

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Both statements are correct.

    Errors should always be added to the error collection. Errors should be raised in VB according to a complex series of rules that basically boil down to something like: "Well integrated ODBC data providers will report all errors to the error collection API, and will also report errors that will affect program flow to the trap API". In other words, an error that is informative should appear in the errors collection without triggering a VB error, but errors that prevent normal program flow should also raise a VB error.

    Note that these rules are not followed by all ODBC providers. Your milage may vary!

    -PatP

  3. #3
    Join Date
    Mar 2004
    Posts
    7
    Thanks, Pat. If I've got it right, provider "warnings" do not also raise errors; "errors" also raise errors? I wonder where I could find the complex set of rules documented?

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    The rules for raising ODBC errors are stated in great detail in the ODBC SDK documentation. This is tough sledding for the average reader, it is intended for someone writing an ODBC driver, usually in a mix of C++ and assembler.

    There are pretty good summaries posted in several of the books on data related programming. Probably the most readable summary (good detail, well explained" is in The Hitchiker's Guide to Visual Basic and SQL Server. There is a more technical but quite usable discussion in ADO.NET Programmer's Reference.

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •