Hello guys;
I'm developing a system in visual basic studio (vb net) and access database 2007.
I would like to know how I can make login form that will have 2 different users accessibility on system, all assign with different password and their service type.
I have two problems, I would like to know how I can use items that are stored in database in logintable, that will make login form work or open when they match with the items that are stored in access database.
My second problem or question, is how I make restriction to the second user to some menus items.
all the user has to access on the same page or form called LibrarySystemForm.
How can I make invisible or hide some items navigation menus in login form that are in LibrarySystemForm.
Here are the code I'm using in loginForm but they work independently.
Imports System.Data.OleDb
Public Class loginform
Dim con As New OleDb.OleDbConnection
Dim da As OleDb.OleDbDataAdapter
Dim cmd As OleDbCommand
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim dbprovider As String = "PROVIDER=Microsoft.ACE.OleDb.12.0;"
Dim dbsource As String = "DATA SOURCE = CUULibDB.mdb.accdb"
con.ConnectionString = dbprovider & dbsource
con.Open()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
Dim command As New OleDb.OleDbCommand
Dim dataset As New DataSet
If UsernameTextBox.Text = ("Librarian") And
SerTypeComboBox.Text = ("Admin") And
PasswordTextBox.Text = ("cavendish2013") And
IdTextBox.Text = ("1") Or
IdTextBox.Text = ("2") And
SerTypeComboBox.Text = ("Assist") And
UsernameTextBox.Text = ("Assistant") And
PasswordTextBox.Text = ("cavendishlib") Then
LibrarySystemForm.Show()
Me.Hide()
Else
MessageBox.Show("Fail, try again")
End If
End Sub
End Class