VB 中将text文本框内容添加的access数据库表,具体代码怎么写?

<br />按上图中显示,将text1-text6输入的内容和日期控件,点击“确定”把数据添加到access数据库data.mdb下的simcard表,表字段分别为“商户名称,商户号,终端号,sim卡号,登记日期,备注”具体代码改怎么写,小弟学习中,只是略懂,用最简单的方法,麻烦代码请添加注释,谢谢各位大侠<br />
Private Sub tianjia() '添加数据.
seta
sql = "select * from [user_info]"
rs.Open sql, cn, adOpenKeyset, adLockOptimistic
rs.AddNew
rs.Fields("user_id") = Trim(txt_id.Text)
rs.Fields("user_name") = Trim(txt_name.Text)
rs.Fields("user_age") = Trim(txt_age.Text)
rs.Fields("user_sex") = Trim(cob_sex.Text)
rs.Fields("user_high") = Trim(txt_high.Text)
rs.Update
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing

End Sub 追问
首先感谢大侠,您这个用与其他项目上,代码基本思路意思我了解了,“seta”不懂,是不是还缺定义呀
追答
Public Function seta()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\dbase\db.mdb;"
cn.Open
End Function
Private Sub tianjia() '添加数据.
seta
sql = "select * from [user_info]"
rs.Open sql, cn, adOpenKeyset, adLockOptimistic
rs.AddNew
rs.Fields("user_id") = Trim(txt_id.Text)
rs.Fields("user_name") = Trim(txt_name.Text)
rs.Fields("user_age") = Trim(txt_age.Text)
rs.Fields("user_sex") = Trim(cob_sex.Text)
rs.Fields("user_high") = Trim(txt_high.Text)
rs.Update
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing

End Sub 追问
首先感谢大侠,您这个用与其他项目上,代码基本思路意思我了解了,“seta”不懂,是不是还缺定义呀
追答
Public Function seta()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\dbase\db.mdb;"
cn.Open
End Function
http://zhidao.baidu.com/question/588181076.html