请各位大侠帮忙

hepengwei 2003-05-13 09:31:49
从表中删除一条记录
怎吗实现不料我的代码是我好着急啊
Dim rsResult As ADODB.Recordset, cnconn As ADODB.Connection
Dim strSQL As String
Set rsResult = New ADODB.Recordset
Set cnconn = New ADODB.Connection
cnconn.Open sStrProvider
strSQL = "Select BOM_CodeNO From Costume_BOMMemo Where BOM_CodeNO like '" & Trim(txtCodeNO.Text) & "'"
rsResult.Open strSQL, cnconn, adOpenKeyset, adLockOptimistic
If Button = 2 Then
If MsgBox("确定要删除这条记录吗?", 36, "注意!") = 6 Then
strSQL = " Delete from Costume_BOM where BOM_CodeNO='" & Trim(txtCodeNO.Text) & "' and BOM_Type='" & Trim(txtCodeNO.Text) & "' and BOM_NO='" & Trim(txtCodeNO.Text) & "' "
cnconn.Execute strSQL
SGrid.Refresh

End If
End If
...全文
33 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
hepengwei 2003-05-16
  • 打赏
  • 举报
回复
我解决了
hepengwei 2003-05-13
  • 打赏
  • 举报
回复
也不好用
bopite 2003-05-13
  • 打赏
  • 举报
回复
Dim rsResult As ADODB.Recordset
Dim cnconn As ADODB.Connection
Dim strSQL As String
Set rsResult = New ADODB.Recordset
Set cnconn = New ADODB.Connection
cnconn.Open "连接数据库"
If Button = 2 Then
If MsgBox("确定要删除这条记录吗?", 36, "注意!") = 6 Then
strSQL.open" Delete from Costume_BOM where BOM_CodeNO='" & Trim(txtCodeNO.Text) & "' and BOM_Type='" & Trim(txtCodeNO.Text) & "' and BOM_NO='" & Trim(txtCodeNO.Text) & "' ",cnconn, adOpenKeyset, adLockOptimistic
cnconn.Execute strSQL
SGrid.Refresh

End If
End If
hepengwei 2003-05-13
  • 打赏
  • 举报
回复
不好用
饮水需思源 2003-05-13
  • 打赏
  • 举报
回复
If MsgBox("确定要删除这条记录吗?", 36, "注意!") = 6 Then
改成:
if msgbox("确定要删除这条记录码?",vbyesno+vbquestion,"提示")=vbyes then
试试
hepengwei 2003-05-13
  • 打赏
  • 举报
回复
大家帮帮忙啊

1,066

社区成员

发帖
与我相关
我的任务
社区描述
VB 资源
社区管理员
  • 资源
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧