回复 3# basc
不好意思,代码没有跑过,再试试这样呢
Local $mdb_data_path = @ScriptDir & "\1.mdb", $mdb_data_pwd = "123456"
Local $tblname = "userinfo"
Local $lastNum, $lastkey,$lastName
$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 last(id_num) as lastnum From " & $tblname & " " )
$lastNum = $RS.fields("lastnum").value
$RS.close
$RS.Open("Select last(id_key) as lastKey From " & $tblname & " " )
$lastkey = $RS.fields("lastKey").value
$RS.close
$RS.Open("Select last(id_Name) as lastname From " & $tblname & " " )
$lastName = $RS.fields("lastName").value
$RS.close
$addfld.Close
MsgBox(0, 0, "id_num = " & $lastNum & @CRLF _
& "id_key = " & $lastkey & @CRLF _
& "id_name = " & $lastName)
|