Results 1 to 16 of 16

Thread: Catch SqlServer Errors in VB6

Hybrid View

  1. #1
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Catch SqlServer Errors in VB6

    That's just luck I'm afraid - you aren't checking the error code at all (what you are accidentally doing there is actually a Bit manipulation and conversion to boolean, which will always be true).

    It should be like this:
    Code:
    If Err.Number = adRecIntegrityViolation Or Err.Number = adErrIntegrityViolation Then

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Posts
    111

    Re: Catch SqlServer Errors in VB6

    Quote Originally Posted by si_the_geek
    It should be like this:
    Code:
    If Err.Number = adRecIntegrityViolation Or Err.Number = adErrIntegrityViolation Then
    Now it doesnot work. is till showing this message

    Violation of UNIQUE KEY constraint 'IX_AppInformationOfBillingByInsuranceAndServiceArea_1'. Cannot insert duplicate key in object 'AppInformationOfBillingByInsuranceAndServiceArea'.

Posting Permissions

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



Click Here to Expand Forum to Full Width