Private Sub registerUser
Private cur as Cursor = SQL1.ExecQuery($"SELECT * FROM PRODUCTS WHERE CODBARRAS=${id}"$)
If cur.RowCount = 0 Then
SQL1.ExecNonQuery($"INSERT INTO PRODUCTS VALUES(Null, '${name})'"$)
Else
'Of course you should use the MsgboxAsync call below, I'm just too lazy to write all the code for you.
Msgbox("Duplicate Registration", "Registration has already been added!")
End If
End Sub
OR
Private Sub registerUser
If SQL1.ExecQuerySingleResult($"SELECT * FROM PRODUCTS WHERE CODBARRAS=${id}"$) = Null Then
SQL1.ExecNonQuery($"INSERT INTO PRODUCTS VALUES(Null, '${name})'"$)
Else
'Of course you should use the MsgboxAsync call below, I'm just too lazy to write all the code for you.
Msgbox("Duplicate Registration", "Registration has already been added!")
End If
End Sub