本帖最后由 xuanniao110 于 2016-5-8 13:03 编辑 Func max()
$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 " & "01mon")
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
数据表如下
|