I'd recommend reading a tutorial on database access in the first instance.

Jmcilhinney's code bank article covers all you need to know to get you going.