Don't add capabilities to lib/db/access.php. The only way to get Moodle to load them is to edit the main version.php, and that is a really bad idea.
If you need step-by-step instructions for this, I suggest you enrol yourself in the Moodle Development course at http://dev.moodle.org/. That gives you a nice, step-by-step tutorial on creating a Moodle block. Other types of Moodle plugin are similar. The bit about capabilties is http://dev.moodle.org/mod/resource/view.php?id=52, but you may want to start and the beginning of the course and work your way through.