本帖最后由 xuanniao110 于 2016-5-5 17:04 编辑 Func max()
$mdb_data_path = @ScriptDir & "\wfj.mdb"
$mdb_data_pwd = "123456"
$tblname = "wfj"
$adCol = "sx"
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $mdb_data_path & ";Jet Oledb:Database Password=" & $mdb_data_pwd)
$RS = ObjCreate("ADODB.Recordset")
$RS.ActiveConnection = $addfld
$RS.Open("SELECT MAX(" & $adCol & ") as maxvalue FROM " & $tblname )
While Not $RS.eof And Not $RS.bof
If @error = 1 Then ExitLoop
GUICtrlSetData($Input1,$RS.Fields (0).value)
$RS.movenext
WEnd
$RS.close
$addfld.Close
EndFunc ;==>max
代码没有任何问题 留后人使用 |