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
An error always pops up when running the program. May I have some help?
This is the error
Dynamic SQL Generation for the delete command is not supported against a Select Command that thus not return any key column information.