Dim cn As New ADODB.ConnectionDim command As New ADODB.command
cn.Open FrmMain.str1mes = MsgBox("您真的要删除该类吗?", vbOKCancel + vbInformation, "提示")
If mes = vbOK Then
ListView1.ListItems.Remove (ListView1.SelectedItem.Index)
command.ActiveConnection = cn
command.CommandText = "delete * from sort where 类别名='" & ListView1.SelectedItem.text & "'"
command.Execute
MsgBox "该类已经删除!", vbInformation, "提示"
cn.Close
但我按上面的做,删除的是选定记录的上一条.请问是怎么回事
cn.Open FrmMain.str1mes = MsgBox("您真的要删除该类吗?", vbOKCancel + vbInformation, "提示")
If mes = vbOK Then
ListView1.ListItems.Remove (ListView1.SelectedItem.Index)
command.ActiveConnection = cn
command.CommandText = "delete * from sort where 类别名='" & ListView1.SelectedItem.text & "'"
command.Execute
MsgBox "该类已经删除!", vbInformation, "提示"
cn.Close
但我按上面的做,删除的是选定记录的上一条.请问是怎么回事
解决方案 »
- vsflexgrid的checkbox如何设置为不可以修改
- VB中如何实现模糊查询,谢谢指点!!
- 据说有这样新的木马技术:把DLL木马注射到其他exe文件中,使其成为木马的合法载体(如explorer.exe中),请问该如何实现?
- 如果让一个picture1(宽120,高3200)随着鼠标在水平方向上移动,鼠标向左(右),它也向左(右),期间,它的大小不变,怎样写代码
- 请问如何判断一个窗口是否处于激活状态?
- 他一定很爱你
- 真的是弄不清楚
- vb+winsock访问远程数据库问题
- 这是我我第三天学编程。初用VB。可有点问题。请各“大虾”指教。
- 如何在VB程序中插入空记录?
- 我输入到文本框后。改过的文本我用commondialog.showsave为何另存不起来呢?
- 巴顿呢?怀念巴顿~!!
If mes = vbOK Then
str=CStr(ListView1.ListItems(i).SumItems(j))
ListView1.ListItems.Remove (ListView1.SelectedItem.Index)
command.ActiveConnection = cn
command.CommandText = "delete * from sort where 类别名='" str & "'"
command.Execute
MsgBox "该类已经删除!", vbInformation, "提示"
cn.Close
end if