本帖最后由 chzj589 于 2016-10-27 13:43 编辑
回复 49# heroxianf
您帮忙看一看,要怎样修改
Func _ButtonReset()
;Case $Msg = $GUI_ButtonReset;更改
If ThisStringIsEmpty($GUI_Input2) Then
MsgBox(0, "错误提示..", "目前只能通过编号更改,请输入编号!")
ThisInputClear()
Else
SQLiteUpateName($TableName, GUICtrlRead($GUI_Input1), GUICtrlRead($GUI_Input2), GUICtrlRead($GUI_Input3), GUICtrlRead($GUI_Input4), GUICtrlRead($GUI_Input5), GUICtrlRead($GUI_Input6), GUICtrlRead($GUI_Input7), GUICtrlRead($GUI_Input8), GUICtrlRead($GUI_Input9))
EndIf
EndFunc ;==>_ButtonReset
;keyValue是匹配健 namevalue是新名字
Func SQLiteUpateName($TableName, $a, $b, $c, $d, $e, $f, $keyValue, $nameValue, $AgeValue)
;$keyValue1, $keyValue2, $keyValue3, $keyValue4,
GUICtrlSendMsg($GUI_ListBox, $LVM_DELETEALLITEMS, 0, 0)
ConsoleWrite($keyValue & @LF)
ConsoleWrite($nameValue & @LF)
ConsoleWrite($AgeValue & @LF)
_SQLite_Open($SQLite_Data_Path)
_SQLite_QuerySingleRow(-1, "SELECT IDs FROM people WHERE IDs = '" & $keyValue & "' ;", $aRow)
Local $empty = $aRow[0]
If $empty = "" Then
MsgBox(0, "错误提示", "您输入的编号不存在,请重新输入")
EndIf
_SQLite_Exec(-1, "UPDATE people SET NAME = '" & $nameValue & "' WHERE IDs = '" & $keyValue & "' ;")
_SQLite_Exec(-1, "UPDATE people SET Age = '" & $AgeValue & "' WHERE IDs = '" & $keyValue & "' ;")
_SQLite_Exec(-1, "UPDATE people SET Age1 = '" & $AgeValue & "' WHERE IDs = '" & $keyValue & "' ;")
_SQLite_Exec(-1, "UPDATE people SET Age2 = '" & $AgeValue & "' WHERE IDs = '" & $keyValue & "' ;")
_SQLite_Exec(-1, "UPDATE people SET Age3 = '" & $AgeValue & "' WHERE IDs = '" & $keyValue & "' ;")
_SQLite_Exec(-1, "UPDATE people SET Age4 = '" & $AgeValue & "' WHERE IDs = '" & $keyValue & "' ;")
_SQLite_Exec(-1, "UPDATE people SET Age5 = '" & $AgeValue & "' WHERE IDs = '" & $keyValue & "' ;")
_SQLite_Exec(-1, "UPDATE people SET Age6 = '" & $AgeValue & "' WHERE IDs = '" & $keyValue & "' ;")
_SQLite_Exec(-1, "UPDATE people SET Age7 = '" & $AgeValue & "' WHERE IDs = '" & $keyValue & "' ;")
_SQLite_Close()
EndFunc ;==>SQLiteUpateName
$a, $b, $c, $d, $e,是我加上去的,不行 |