1.Buka module baru seperti gambar dibawah
2. Kita buat koneksi
Listing Program
- Imports System.Data.OleDb
- Module Module1
- Public CONN As OleDbConnection
- Public CMD As OleDbCommand
- Public DS As New DataSet
- Public DA As OleDbDataAdapter
- Public RD As OleDbDataReader
- Public lokasidata As String
- Sub koneksi()
- lokasidata = "provider=microsoft.jet.oledb.4.0;data source=dbpenjualan.mdb"
- CONN = New OleDbConnection(lokasidata)
- If CONN.State = ConnectionState.Closed Then
- CONN.Open()
- End If
- End Sub
- End Module
Selajutnya Klik Dua kali pada Button
Listing Program
- Imports System.Data.OleDb
- Public Class login
- Private Sub btnlogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlogin.Click
- If Username.Text = "" Or Passwrd.Text = "" Then
- MsgBox("Data login belum lengkap")
- Exit Sub
- Else
- Call koneksi()
- CMD = New OleDbCommand("select * from tblkasir where nama_kasir='" & Username.Text & "' and pwd_kasir='" & Passwrd.Text & "'", CONN)
- RD = CMD.ExecuteReader
- RD.Read()
- If RD.HasRows Then
- Me.Visible = False
- MenuUtama.Show()
- End If
- End If
- End Sub
- Private Sub login_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Passwrd.PasswordChar = "*"
- End Sub
- Private Sub Btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesBtnkeluar.Click
- End
- End Sub
- End Class
Sebelum Pada tblkasir kita isikan dulu datanya
Hanya bermodal HP android bisa mendapatkan $10 melalui WHAFF
0 comments:
Posting Komentar