Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2008
    Posts
    3

    Unanswered: How it might capture the mistakes odbc from Access

    I have a project created in access 2003 on database SQL Server 2005 Express.

    I need to handle the messages of mistake that SQL generates from Access (for example, from a form), to translate them and to manage them with an own function.

    But do not be how to do it. I have seen Access's managing mistake, but it does not serve.

    Thank you.

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Are you asking for code which translates SQL Server errors in MSAccess?
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Jul 2008
    Posts
    3
    What I want is to control the mistakes ODBC that jump me in my application Access.

    An example of mistake is the one that takes place when a field not null is made empty. (i use Sql Server as back-end).

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    You might want to handle mistakes (such as when a field is empty or null) via the MSAccess front-end. I would highly suggest coding this into the front-end mdb/mde interface such as on an MSAccess form. Otherwise, you could possibly write a stored procedure (or trigger) which checks error codes generated in SQL Server. I use SQL Server as a back-end and MSAccess as a front-end and have found it much easier to generate error handling in the front-end and have to ask why you would want to do this via the back-end and not in the front-end? If you do it via the front-end, you can intercept the data before it even gets to the point of writing it to SQL Server. My curiosity and big question is to why an MSAccess form does not meet your needs. I've never ever had an issue (in 20+ years developing) of handling data error issues via an MSAccess form.

    I think you'll find that almost everyone else writes code in the MSAccess form to handle errors. If you are not using an MSAccess form to enter data (ie. data is entered directly into the SQL Server table), this would not be the suggested method and a form would highly be the preferred method by almost every developer. You have a lot more control (and it is much easier) designing your error handling in an MSAccess form. Plus I think you'll have more data writing issues trying to do your error handling via SQL Server. If you're absolutely intent on handling data error issues via SQL Server, my only suggestion would be doing it via a stored procedure or trigger (I have designed triggers to update data in linked tables and this worked very well but I wouldn't go the route of handling data error issues this way.)
    Last edited by pkstormy; 07-14-08 at 19:55.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I have seen Access's managing mistake, but it does not serve.
    Maybe you could elaborate a little bit on your problem... Why does Access' error handling not "serve"??

    If you are trying to handle the storing of a null in a non-null field, then you need to apply some basic logic to handle that -- don't try to put a null in it or remove the NOT NULL property of the field in SQL Server.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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