VB中Text输入的内容写入到access数据库中 5
展开全部
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
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
追问
可以来点注释吗......0.0
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询