R
richardkreidl
I'm trying to check for duplicates before I do an INSERT into the
Access database table. I basically want to alert the user if the
'ProjectName' and the 'MileStones' are already in the table..
thanks
Code Below:
Private Sub btnADD_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnADD.Click
strSQL = "INSERT INTO Project" & _
"(ProjectName, Planned, Actual, MileStones, Status,
[Next], Comments)VALUES " & _
"('" & txtProject.Text & "'," & _
"'" & txtPlanned.Text & "','" & txtActual.Text & "'," & _
"'" & txtMile.Text & "','" & txtStatus.Text & "'," & _
"'" & txtNext.Text & "','" & txtComment.Text & "')"
connection.Open()
Dim cmd As New OleDbCommand(strSQL, connection)
cmd.ExecuteNonQuery()
connection.Close()
End Sub
Access database table. I basically want to alert the user if the
'ProjectName' and the 'MileStones' are already in the table..
thanks
Code Below:
Private Sub btnADD_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnADD.Click
strSQL = "INSERT INTO Project" & _
"(ProjectName, Planned, Actual, MileStones, Status,
[Next], Comments)VALUES " & _
"('" & txtProject.Text & "'," & _
"'" & txtPlanned.Text & "','" & txtActual.Text & "'," & _
"'" & txtMile.Text & "','" & txtStatus.Text & "'," & _
"'" & txtNext.Text & "','" & txtComment.Text & "')"
connection.Open()
Dim cmd As New OleDbCommand(strSQL, connection)
cmd.ExecuteNonQuery()
connection.Close()
End Sub