Access database
Posted: Mon Aug 29, 2016 10:12 pm
Hello,
I use this code below it logs me in fine all working i have a filed called roll say i have the roll as Admin and i want to display a menu strip how do i go about this but if there normal account type then the menu strip wont show this is the code i have at the moment?
Mark
I use this code below it logs me in fine all working i have a filed called roll say i have the roll as Admin and i want to display a menu strip how do i go about this but if there normal account type then the menu strip wont show this is the code i have at the moment?
Code: Select all
Thanks Private Sub login()
Try
sqL = "SELECT * FROM users WHERE Username = '" & txtUsername.Text & "' AND Password = '" & txtPassword.Text & "'"
ConnDB()
cmd = New OleDbCommand(sqL, conn)
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
If dr.Read = True Then
txtUsername.Text = ""
txtPassword.Text = ""
Me.Close()
Else
MsgBox("Incorrect username or Password!", MsgBoxStyle.Critical, "Login")
txtPassword.Focus()
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
cmd.Dispose()
conn.Close()
End Try
End Sub
Mark