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(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles btnADD.Click
strSQL = "INSERT INTO Project" & _
"(ProjectNa me, 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(st rSQL, connection)
cmd.ExecuteNonQ uery()
connection.Clos e()
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(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles btnADD.Click
strSQL = "INSERT INTO Project" & _
"(ProjectNa me, 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(st rSQL, connection)
cmd.ExecuteNonQ uery()
connection.Clos e()
End Sub
Comment