Imports System.Data.OleDb Public Class LoginCuuLibForm Dim con As New OleDbConnection Private Sub LoginCuuLibForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load con.ConnectionString = "Provider= Microsoft.ACE.OLEDB.12.0;Data Source = CUULibDB.mdb.accdb; persist security info =false" End Sub Public Function ask() Dim dt As New DataTable Dim ds As New DataSet ds.Tables.Add(dt) con.Open() Dim da As New OleDbDataAdapter("Select * from login", con) da.Fill(dt) For Each datarow In dt.Rows If txtUsername.Text = datarow.item(1) And txtPassword.Text = datarow(2) And cobSertype.Text = datarow(3) Then con.Close() Return True End If Next con.Close() Return False End Function Private Sub btnLog_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLog.Click If ask() = True Then LibrarySystemForm.Show() Else MessageBox.Show("invalid") End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click txtUsername.Clear() txtPassword.Clear() End Sub End Class
User
Registration
Login
Role
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)