如何在vb中实现对数据库表中信息的删除
a=Trim(Text1.Text)myssql="insertinto意见箱values('"&Trim(Text2.Text)&"','"&Trim(Text3.Te...
a = Trim(Text1.Text)
myssql = "insert into 意见箱 values('" & Trim(Text2.Text) & "', '" & Trim(Text3.Text) & "', '" & a & " ')"
my = "delete from 未回复意见 where 信息=" & Trim(Text3.Text) & ""
cnn.Execute myssql, my
MsgBox ("☆☆回复成功☆☆!")
rs.Requery
rs.MoveLast
Text1.Locked = True
cmdsave.Enabled = False
cmdadd.Enabled = True
Else
myval = MsgBox("☆你要取消回复?☆", vbYesNo)
If myval = vbYes Then
rs.CancelUpdate
rs.MoveFirst
Call viewdata
cmdsave.Enabled = False
Text1.Locked = True
cmdadd.Enabled = True
Exit Sub
Else
Text1.SetFocus
End If
End Sub
定义的my为什么无法实现删除的功能 展开
myssql = "insert into 意见箱 values('" & Trim(Text2.Text) & "', '" & Trim(Text3.Text) & "', '" & a & " ')"
my = "delete from 未回复意见 where 信息=" & Trim(Text3.Text) & ""
cnn.Execute myssql, my
MsgBox ("☆☆回复成功☆☆!")
rs.Requery
rs.MoveLast
Text1.Locked = True
cmdsave.Enabled = False
cmdadd.Enabled = True
Else
myval = MsgBox("☆你要取消回复?☆", vbYesNo)
If myval = vbYes Then
rs.CancelUpdate
rs.MoveFirst
Call viewdata
cmdsave.Enabled = False
Text1.Locked = True
cmdadd.Enabled = True
Exit Sub
Else
Text1.SetFocus
End If
End Sub
定义的my为什么无法实现删除的功能 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询