VB与access数据库调用问题
各位大神:怎么在VB里把数据库access内容调用出来,实现在把两个加数大于10的加数在窗体显示出来。数据库是database13.mdb
数据表是如图
db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\database13.mdb;Persist Security Info=False" db.Open '这样就连接了database13.mdb数据库,但数据库必须在VB程序的目录中。 Dim RSstr As String, A As Integer, B As Integer, C As Integer RSstr = "select * from 表2 " RS.Open RSstr, db, 2, 2 Do While Not RS.EOF A = RS!加数1: B = RS!加数2: C = A + B If C > 10 Then Print C; RS.MoveNext Loop RS.Close Set RS = Nothing db.Close Set db = Nothing
[此贴子已经被作者于2018-4-24 06:27编辑过]