本帖最后由 KLU3K 于 2009-8-10 00:39 编辑
在代码和数据库都在附件中。
删除不掉我选择的数据。奇怪啊
提示错误在72行:
$addfld.execute($sQuery)^ ERROR
不想下附件的看一下删除部分的代码:Func del()
$Strn = GUICtrlRead(GUICtrlRead($ListView1))
$Strnspin = StringSplit($Strn, "|")
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $mdb_data_path)
$iMsgBoxAnswer = MsgBox(266276, "删除确认", "你确定要删除【" & $Strnspin[1] & "】这条记录?")
Select
Case $iMsgBoxAnswer = 6 ;是
$Strn = GUICtrlRead(GUICtrlRead($ListView1))
$Strnspin = StringSplit($Strn, "|")
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $mdb_data_path)
$sQuery = "DELETE FROM " & $tblname & " IN '" & $mdb_data_path & "' WHERE Date" & " = " & $Strnspin[1]
MsgBox(0, "Debug", $sQuery)
$addfld.execute($sQuery)
$addfld.close
MsgBox(4096, "删除成功:", "【"& $Strnspin[1] & "】这条记录删除成功!!!")
Case $iMsgBoxAnswer = 7 ;否
du()
EndSelect
EndFunc ;==>del
|