Results 1 to 7 of 7

Thread: [2005] #error data value problem in ms access

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    7

    [2005] #error data value problem in ms access

    my windows service crashes because of an unhandled exception in an oledb select command on ms access, i found that tables in query contain #Error as data value in some fields , can anyone tell me how to handle this case

  2. #2
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: [2005] #error data value problem in ms access

    1. Fix the cause of the error if possible.
    2. Use a Try/Catch block to handle exceptions and perform appropriate actions should an exception occurs.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    7

    Re: [2005] #error data value problem in ms access

    1.I already used try/catch block it cannot catch this exception.
    2. Actually data is inserted by a window application designed in vb6 with ms access as backend. I cannot change that application becuase it's not mine. All i have to do is to copy data from ms access to centralised sql server and make reports only.
    3. I only want to copy rows which wont contain any data value #error

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] #error data value problem in ms access

    As you say, your app is crashing because of an unhandled exception. Identify the exception and handle it.

    That said, if you try to retrieve the entire table in one go then you may well get nothing because the single operation will fail. You may have to query the table one row at a time and ignore those rows for which it fails. It will still be the same exception you're getting now though, so you've still got to work out how to handle that.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    7

    Re: [2005] #error data value problem in ms access

    1. It throws an unhandled exception of mscorlib.dll which cannot be handled by try/catch block vb code.
    2. I cannot select single row at a time i have to select whole table because of speed issues and i am using sql bulk copy class to copy selected rows from ms access to sql server automatically through my windows service

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] #error data value problem in ms access

    I don't think there's a magic solution. If the data can't be bulk copied because it's got errors in it and you can't change the data to get rid of the errors then I'd say that you can't use bulk copy. Of course, you could always show us the code you're using, a sample of the data and the details of the error. If you want informed advice then you need to inform us. We shouldn't be finding out the details in post #5.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    7

    Re: [2005] #error data value problem in ms access

    I need my query select only rows that don't have #error as data value

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