Handling Returned errors in VB

  • I'm looking for some direction on handling trapped errors in Vb. Specifically, I have a table defined with a unique index and 1 constraint. If I attempt to update the table in violation of either, an error is thrown, but it' the same error number. What do I need to do to dig a little deeper and determine which of the two caused the error.

    Thx

  • If you're using ADO loop through the ADO errors collection. Sometimes the error messages you get from VB/SQL are less than thrilling.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • I'll check that. What I am trying to figure out is how is the ERR.Description being built. Consider the following:

    UPDATE statement conflicted with COLUMN CHECK constraint 'CK_Region'. The conflict occurred in database 'Catv3', table 'Region', column 'Zip'.

    Clearly this statement is being built on the fly (since the same ERR.NUMBER generates different messages.) Question is what is ADO looking at to do this? For now I can parse the messages individually to narrow down the problem.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply