|
发表于 2015-8-2 20:16:39
|
显示全部楼层
回复 7# netba
你提供的<数据库文件-date.mdb>有点问题。查询不是最后一条记录
$mdb_data_path = @ScriptDir & "\date.mdb"
$tblname = "gbook"
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $mdb_data_path)
$RS = ObjCreate("ADODB.Recordset")
$RS .ActiveConnection = $addfld
$RS.Open("Select " & "*" & " From " & $tblname)
While Not $RS .eof And Not $RS .bof
$Item = $RS.Fields(0).value & @CR & $RS.Fields(1).value & @CR & $RS.Fields(2).value & @CR & $RS.Fields(3).value & @CR & $RS.Fields(4).value & @CR & $RS.Fields(5).value & @CR & $RS.Fields(6).value & @CR & $RS.Fields(7).value & @CR & $RS.Fields(8).value & @CR & $RS.Fields(9).value & @CR & $RS.Fields(10).value
$tbl = $RS.Fields(0).Value
$RS .movenext
WEnd
$RS .close
$addfld .Close
MsgBox(64, "结果", "找到记录,最后记录:"& $Item & "")
If $tbl = 1847 Then ;5454
MsgBox(64, "结果", "找到记录,最高记录:"& $tbl & "")
Else
MsgBox(64, "结果", "没有这个记录,最高记录:" & $tbl & "")
EndIf |
|