Im using Microsoft Visual Studio 2012 and Microsoft Access
What code/sql will I add to check whether User is an admin or a regular user? so it can load to a Admin form or Regular user form.
My professor told me to use a FieldName "LoginType" in my database.. but i don't know how to use it.
Here's my Form code:
Private Sub btnSign_Click(sender As Object, e As EventArgs) Handles btnSign.Click Dim Username As String Dim Password As String Username = txtID.Text Password = txtPassword.Text If Me.TblUserTableAdapter.ScalarQueryLogin(Username, Password) Then MessageBox.Show("Welcome you are successfully logged in") Me.Close() frmStudent.Show() Else MessageBox.Show("Invalid Username or Password Please Try Again") txtID.Text = String.Empty txtPassword.Text = String.Empty End If End Sub
SELECT ID, LASTNAME, FIRSTNAME, LOGINTYPE FROM TblUser WHERE (ID = ?) AND (LASTNAME = ?)
Please help This is for my thesis.