Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Data.OleDb
- Public Class login
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Call openConnection()
- Dim dr As OleDbDataReader
- Dim cmd As OleDbCommand
- Dim str As String
- cmd = New OleDbCommand
- cmd.CommandType = CommandType.Text
- cmd.Connection = Connection
- If Tnama.Text = "" Or Tpass.Text = "" Then
- MsgBox("mangga isian hela ! ")
- Tnama.Focus()
- Exit Sub
- Else
- 'Call openConnection()
- str = "select * from user where username='" & Tnama.Text & "' and password='" & Tpass.Text & "' "
- cmd.CommandText = str
- dr = cmd.ExecuteReader()
- dr.Read()
- If dr.HasRows Then
- menuUtama.Show()
- Me.Visible = False
- Else
- MsgBox("Username atau Password salah !")
- End If
- End If
- Connection.Close()
- cmd.Dispose()
- End Sub
- Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement