Imports System.Data.OleDb
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim a As String = TextBox1.Text Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\acer\Desktop\login.mdb") Dim db As New OleDbCommand("Select * From login Where username='" & a & "'", con) con.Open() Dim rdr As OleDbDataReader = db.ExecuteReader() If rdr.HasRows Then MsgBox("Welcome " + a, vbInformation, "Notification") Me.Hide() Form2.Show() ElseIf TextBox1.Text = "" Then MsgBox("Please Input Password", vbCritical, "Notification") Else MsgBox("Invalid Password", vbCritical, "Notification") TextBox1.Text = ""
End If con.Close()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If MsgBox("Are you sure do you want to LogOut?", vbYesNo, "Notification") = vbYes Then
End
End If
End Sub
End Class
Imports System.Data.OleDb
Public Class Form2 Dim con As New OleDbConnection Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load con.ConnectionString = ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\acer\Desktop\payrolll.mdb")
End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged con.Open() Dim dt As New DataTable Dim ds As New DataSet ds.Tables.Add(dt) Dim da As New OleDbDataAdapter
da = New OleDbDataAdapter("select * from payroll where ID like '%" & TextBox1.Text &