

程序代码: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编辑过]
