I want to delete all the contents of a MS Access table however I am not sure how to set up my SQL to do so.
So far I have found this online:
Dim SqlQuery As String = "DELETE * FROM QuestionResults WHERE Quizname = " & txtQuizName.Text & ";"
I have the connection to the database linked up due to my previous code, I am just unsure how to edit this code so that it deletes the contents of the table (i want it to delete every record, not the table itself)
Public provider As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source="
Public dataFile As String = "U:\My Documents\Visual Studio 2013\Projects\COMP4 Project\COMP4 Project\bin\Debug\QuizDatabase.accdb"
Public connString As String
Public myConnection As OleDbConnection = New OleDbConnection
Public dr As OleDbDataReader
connString = provider & dataFile
myConnection.ConnectionString = connString
myConnection.Open()
*. Also use parameters otherwise you're open to SQL injection.