Any connection to database should have the following structure.
Open Connection (with help of connection string) Connection strings
Recordset Object (if results are to be processed)
Open recordset with help of SQL statement and Connection Object.
Check if recordset in not empty.
Then Loop through the Recordset
Move to Next Record.
End of LOOP
set Recordset and connection objects to nothing.
Connecting to a Database
Or google with this link - Connecting to database
Hope that helps.
- Vijay G
Strive for Perfection