adding records to access database

I dont know the context of what youre doing, but one common way is to use OleDbCommand with the method .ExecuteNonQuery(). This would use the Delete statement...

Code:
con is your connection string

Dim recordsAffected As Integer
dim sSql as string = "DELETE ID FROM myTable WHERE ID = " & SomeIntegerVar

Dim cmd As OleDbCommand = New OleDbCommand(sSql, con)
cmd = New OleDbCommand(sSql, con)
recordsAffected = cmd.ExecuteNonQuery()
 
Back
Top