I just want to know which is the correct way to execute a nonquery to catch a duplicate entry Access DB error.
Try
myCommand.ExecuteNonQuery()
Catch ex As Exception
rowsAffected = 0
End Try
myConnection.Close()
Or
Try
myCommand.ExecuteNonQuery()
Catch ex As Exception
rowsAffected = 0
Finally
myConnection.Close()
End Try
This post has been edited by eTech1: 10 September 2010 - 08:56 AM

New Topic/Question
Reply




MultiQuote







|