Form1: "" "" "" "" "Tolong Isi "

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

Imports System.Data.

OleDb
Imports System.Data
Public Class Form1

Private Property rd As Object

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button1.Click
Dim uname As String = ""
Dim pword As String
Dim username As String = ""
Dim pass As String
If TextBox1.Text = "" Or TextBox2.Text = "" Then
MsgBox("tolong isi ")
Else
uname = TextBox1.Text
pword = TextBox2.Text
Dim querry As String = " select password from login where username= '" &
uname & "'"
Dim dbsource As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=login.accdb"
Dim conn = New OleDbConnection(dbsource)
Dim cmd As New OleDbCommand(querry, conn)
conn.Open()
Try
pass = cmd.ExecuteScalar().ToString
Catch ex As Exception
MsgBox("usernametidak ada")
End Try
If (pword = pass) Then
MsgBox("login berhasil")
Form.Show()
If Form.Visible Then
Me.Hide()
End If
Else
MsgBox("login gagal")
TextBox1.Clear()
TextBox2.Clear()
End If
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Me.Close()
End Sub
Public Class setfocus_datagridview
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e
As System.Windows.Forms.DataGridViewCellEventArgs)
If e.ColumnIndex = 0 Then
DGV.CurrentCell = DGV(1, DGV.CurrentCell.RowIndex)
SendKeys.Send("{UP}")
End If
End Sub
End Class
End Sub

Private Function dbsource() As String


Throw New NotImplementedException
End Function

End Class

You might also like