Sub DeleteRecords()
Dim qry As String = "SELECT * FROM Attendance"
Dim daTestTbl As New OleDbDataAdapter(qry, con1)
Dim cbTestTbl As New OleDbCommandBuilder(daTestTbl)
Dim dtTestTbl As New DataTable("Attendance")
Try
daTestTbl.Fill(dtTestTbl)
For Each dr As DataRow In dtTestTbl.Rows
dr.Delete()
Next
daTestTbl.Update(dtTestTbl)
dtTestTbl.Dispose()
daTestTbl.Dispose()
Catch ex As Exception
MsgBox(ex.Message)
End Try
运行程序时总会弹出错误。我可以帮忙吗?
这是错误
Dynamic SQL Generation for the delete command is not supported against a Select Command that thus not return any key column information.