What kind of database access method are you planning to use DAO, RDO or ADO ? Lets say you use RDO and assuming that the connection to the database has already been made.

In the click event of the command button you want to execute the SQL statement, the code will look like :

Dim SQL as string
Dim rs as rdoResultset

SQL = "select fld1,fld2 from employee"

Set rs = MyrdoConn.OpenResultset(sql)

While Not rs.eof

field1=rs("fld1") 'fld1 of the current rec
field2=rs("fld2")
rs.movenext 'move to the next record
Wend