Boss,
As I've already informed, Just use the Code I've Provided, it will work best for you.
Apart from this if you wish to do code to retrieve data just use:
Prrivate Sub cmdok_click()
set rs = new adodb.recordset
rs.open "select * from emp", con, adlockoptimistic, adopendynamic, adcmdtext
set datagrid1.datasource = rs.datasource
end sub
Just use "set datagrid1.datasource = rs.datasource" after every update to update the data grid.
also remember, recordset and connection variables, ie rs and con should be declared on module level.
to get data from any text box just type:
rs!empno = text1.text
Enjoy!
Javed Khan