I know this might be something very simple but it has gotten me scratching my head for some minutes. I want to check if the user entered UserName already exists in MS Access, if it does, the given is rejected.
Here is what I have:
Code:If DTR("UserName") <> TxtUserName.Text.ToString Then 'If Username is available, save the information to the database MyQry = "INSERT INTO UsersTable(UserName,FullName,UserPassword) VALUES('" & TxtUserName.Text "','" & TxtFullName.Text & "','" & TxtConfirmPassword.Text & "')" MyCmd = New OleDbCommand(MyQry, Conn) With MyCmd .ExecuteNonQuery() End With Close() Else MsgBox(Prompt:="The provided UserName is not availble. Plese choose another one.", Buttons:=MsgBoxStyle.Exclamation, Title:="UserNameError") End If




Reply With Quote
