当我用这个代码,它显示错误"EOF如果需要移动的下一个记录集,如果我打电话",而不是RS.EOF上乞讨的循环",然后循环不执行
什么是错误代码。
我想找到最小的数字,从访问数据库使用循环(或任何简单的方法,如果你知道)
如果您有任何其他的方法从数据库中找到最小的数,然后请告诉我吗?
| Vishal我Sahuji:_Damian S_
Dim constr
constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "C:\xyz.mdb;Persist Security Info=False"
Dim con As New ADODB.Connection
con.Open constr
Dim rs As New ADODB.Recordset
rs.Open "Select * from xyz where abc ='A'", con, adOpenDynamic, adLockOptimistic
Dim Aray(1 To 10) As Integer
Dim sn As Integer
Dim i
Dim a
For i = 1 To 10
Aray(i) = rs("xyz")
rs.movenext
Next
sn = Aray(1)
For a = 1 To 10
If Aray(a) < sn Then sn = Aray(a)
Next
MsgBox "The smalles number is: " & sn, vbInformation
rs. closed
con.closed