Results 1 to 17 of 17

Thread: [RESOLVED] Getting error and cannot seem to TRY/CATCH it

Threaded View

  1. #1

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Resolved [RESOLVED] Getting error and cannot seem to TRY/CATCH it

    I am getting this error

    First-chance exception at 0x0f7247b5 (StringLibrary.dll) in Librarian.exe: 0xC0000005: Access violation reading location 0x02e028b8.

    And I assume it's in this piece of code - as I can set a break at the start of the routine - and it never arrives at the bottom of the routine.

    I have never used TRY/CATCH statements - but why wouldn't this work - why is it not breaking in the CATCH?

    Code:
    			try {
    				int s1 = nKeywordskt;
    				int s2 = s1;
    				int s3 = 0, s4 = 0, s5 = 0, s6 = 0;
    				int a = 0;
    .
    .
    .
    				s1 = 0; // dummy line
    			} catch (int errCode) {
    				errCode = errCode;
    			}
    I set a break at this line int s1 = nKeywordskt and at the s1 = 0; // dummy line and also at the errCode = errCode line.

    It breaks at the top - and never arrives at the bottom (getting the error noted at the top of this post instead).

    But why does it not arrive in the CATCH??
    Last edited by szlamany; Sep 13th, 2012 at 05:07 PM.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

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