Hi Shoaib,
Any connection to database should have the following structure.
Connection object.
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
Display/Process records.
Move to Next Record.
End of LOOP
Close Recordset
Close connection
set Recordset and connection objects to nothing.
Connecting to a Database
Or google with this link -
Connecting to database
Hope that helps.
Cheers!
_________________________
- Vijay G
Strive for Perfection