交谈中请勿轻信汇款、中奖等消息,更不要透露密码、银行帐号等个人信息。彭坤 19:10:11
Dim s1, s2, str As String
DataGrid1.Col = 0
a = DataGrid1.Text
DataGrid1.Col = 2
s1 = DataGrid1.Text
Adodc1.Recordset.MovePrevious
Do While 1 = 1
If Not Adodc1.Recordset.BOF Then
DataGrid1.Col = 2
s2 = DataGrid1.Text
If s2 = s1 Then
If MsgBox("你确定要删除图书库编号为" & a & "吗?", vbInformation + vbOKCancel, "删除") = vbOK Then
str = "select * from bookinfo1 where 图书库编号=" & CInt(a)
' str = "delete from bookinfo1 where 图书库编号=" & CInt(a)
' g_db.Execute (str)
'
Set g_rs = g_db.OpenRecordset(str)
g_rs.Delete Set g_rs = Nothing
strsql = "select * from bookinfo1 where ISBN in (select ISBN from bookinfo1 group by ISBN having count(ISBN)>1)"
Adodc1.CursorLocation = adUseClient
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = strsql
Adodc1.Refresh
' GG
If Adodc1.Recordset.RecordCount < 1 Then
Command4.Enabled = False
Command5.Enabled = False
Command6.Enabled = True
Exit Do
End If
Exit Do
Else
Exit Sub
End If
Else
Adodc1.Recordset.MovePrevious
End If
Else
MsgBox "该记录不可删除!"
Exit Do
End If Loop
Dim s1, s2, str As String
DataGrid1.Col = 0
a = DataGrid1.Text
DataGrid1.Col = 2
s1 = DataGrid1.Text
Adodc1.Recordset.MovePrevious
Do While 1 = 1
If Not Adodc1.Recordset.BOF Then
DataGrid1.Col = 2
s2 = DataGrid1.Text
If s2 = s1 Then
If MsgBox("你确定要删除图书库编号为" & a & "吗?", vbInformation + vbOKCancel, "删除") = vbOK Then
str = "select * from bookinfo1 where 图书库编号=" & CInt(a)
' str = "delete from bookinfo1 where 图书库编号=" & CInt(a)
' g_db.Execute (str)
'
Set g_rs = g_db.OpenRecordset(str)
g_rs.Delete Set g_rs = Nothing
strsql = "select * from bookinfo1 where ISBN in (select ISBN from bookinfo1 group by ISBN having count(ISBN)>1)"
Adodc1.CursorLocation = adUseClient
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = strsql
Adodc1.Refresh
' GG
If Adodc1.Recordset.RecordCount < 1 Then
Command4.Enabled = False
Command5.Enabled = False
Command6.Enabled = True
Exit Do
End If
Exit Do
Else
Exit Sub
End If
Else
Adodc1.Recordset.MovePrevious
End If
Else
MsgBox "该记录不可删除!"
Exit Do
End If Loop
g_rs.update
试试看
出现错误!
在不使用addnew 或edit的情况下 更新 update 或取消更新
出现这样的提示!
帮忙解决下