Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in inserting record,,1st rec is added once, 2nd record is added twice, and so on,,,!!

 
varun nurav
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
i m getting a problem in my project when i m inserting a record in database (MS ACCESS). i click on add button on main frame and a new frame is opened for adding details
i add details and click on save button and a function refresh is called, record gets inserted. now again i want to insert a new record i do same thing, but this time record is inserting two times and if i insert 3rd time insertion is 3 times and so on,,,i have used a list to show only column 1 entries of db and all labels to show all entries on the same frame ie the main frame.


 
Campbell Ritchie
Sheriff
Posts: 48394
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I am afraid nobody is going to look through over 600 statements to find your error. I have tried to improve your code by adding code tags, which simply highlighted how inconsistent your indentation was, with multiple statements per line, and some very long lines. I have got rid of the long lines, but made the indentation look even worse.
I notice some empty catch blocks. Those are dangerous; you are hiding errors from yourself.

You will have to boil this down to something small and simple, not more than about 50 lines, which demonstrates the error, (ie an SSCCE), then we can understand it and can help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic