+ Post New Thread
Results 1 to 3 of 3
Web Development Thread, ASP Database error trapping in Coding and Web Development; Hi all. I've created a little web app that will take CSV files of certificate nominations, enter them into a ...
  1. #1

    TechMonkey's Avatar
    Join Date
    Dec 2005
    South East
    Thank Post
    Thanked 433 Times in 315 Posts
    Rep Power

    ASP Database error trapping

    Hi all. I've created a little web app that will take CSV files of certificate nominations, enter them into a database ready for printing out by the office. Now it all works, the only problem is that if the person entering the data can't spell their subject correctly or can't remember what year tutor groups are in or even spell them right (no bitterness at all I'm sure you can notice) of course the page will throw up an ADO error and stop importing, leaving some of the entered lines there but not all.
    I have a rough idea how to trap errors, I have a rough idea on how to show teh error and give them a clue about what they have done wrong. My poor little brain can not seem to work out if using an Access DB will an ASP page be able to either roll back the DB or stop the data being entered if an error is generated?
    I think it isn't possible as Access doesn't do roll backs and as the error is generated as teh data is being entered you can't stop the previously entered data being there. But confirmation or other ideas are always welcome.

    Last edited by TechMonkey; 2nd April 2008 at 01:15 PM.

  2. #2
    Richie's Avatar
    Join Date
    May 2007
    Somewhere in Derbyshire
    Thank Post
    Thanked 3 Times in 3 Posts
    Rep Power
    You could try importing the data into a new table (a temporary one created in your code).

    Watch for errors during import, if there are any you could show a message to the user informing them and drop the new table.

    If there are no errors, a second routine could then read the new table and copy the data to the main table.

    If the web app is available to more than one person at a time and it is possible to run two imports at once, make sure the temp tables are named using either session data or some random characters so each user gets their own temporary table.

    All this sounds like a lot of work but from what you said, you have most of what you need in place already.

  3. #3

    SYNACK's Avatar
    Join Date
    Oct 2007
    Thank Post
    Thanked 2,749 Times in 2,322 Posts
    Blog Entries
    Rep Power
    I'm not 100% on whether you can make access do roll backs, I don't think you can as it is not fully transaction based. I have a couple of suggestions though. Option one keeping your current system you could add another table into your database with the exact same layout as the final one, import your data to here first which will tell you if you have an error or not, if the ASP catches an error it simply deletes the contents of this table and shows up the error to the user. If it succeeds you can either transfer the rows across to the main table or do another import right into the main table then kill the data in the transfer table.

    Option two would be doing the validation client side by having the users enter the certificates into a nice teacher resistant form with drop downs for subjects and students etc.

    I guess option three would be using SQL express 2k5 instead as this is quite good but it depends on your current setup and needs.

+ Post New Thread

Similar Threads

  1. Help with Access Database
    By LozWesson in forum Group Project
    Replies: 7
    Last Post: 11th July 2012, 04:33 PM
  2. access database
    By Uraken in forum Coding
    Replies: 0
    Last Post: 11th October 2007, 12:19 PM
  3. HELP!!!! - Database
    By lalalalalalalalalalala in forum How do you do....it?
    Replies: 1
    Last Post: 21st March 2007, 10:03 PM
  4. Replies: 4
    Last Post: 28th February 2007, 10:37 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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