For starters, event button handling has nothing to do with DB access. It just happens to be where it occurs, and is irrelevant.
What is the "problem"? What do you have so far, what happens if you execute that code, and how does that deviate from what you expected to happen?
TellTheDetails, and post a short, relevant extract from the code.