Thanks a lot MARTIN for the nitpick. REALLY needed that! Inspite of what you mentioned that you are relatively new to web2py, that was a lot of help.
I don't know if other are going to help me out as much as you did. But since you did take the trouble to pore through my code, I was hoping that you would help me out a little bit more till such time you feel that you can spare time for it. I do have a lot more queries and would like to tackle them one at a time. Can I request you to subscribe to this post so that you get a notification of any posts that I make so that you can reply to it? Also, I don't know how the code from the db.py was missing. I will fix my code as per your guidelines and post it again. Rupesh