If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > What is the correct position re. ADO errors

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-07-04, 08:57
jsoans jsoans is offline
Registered User
 
Join Date: Mar 2004
Posts: 7
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
Reply With Quote
  #2 (permalink)  
Old 05-07-04, 10:08
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,606
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
Reply With Quote
  #3 (permalink)  
Old 05-07-04, 23:33
jsoans jsoans is offline
Registered User
 
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?
Reply With Quote
  #4 (permalink)  
Old 05-08-04, 11:43
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,606
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On