如何vb把text控件内容导入access库并保存
展开全部
Private Sub Command2_Click()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=access数据库路径"
rs.Open "select * from 表 where 查询条件", cn, adOpenKeyset, adLockOptimistic
rs.addnew
rs.Fields ("字段名")=text.text
rs.update
rs.close
end sub
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=access数据库路径"
rs.Open "select * from 表 where 查询条件", cn, adOpenKeyset, adLockOptimistic
rs.addnew
rs.Fields ("字段名")=text.text
rs.update
rs.close
end sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询