Advertisement
Guest User

asas

a guest
Feb 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. Imports System.Data.OleDb
  2. Public Class login
  3.  
  4. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  5. Call openConnection()
  6. Dim dr As OleDbDataReader
  7. Dim cmd As OleDbCommand
  8. Dim str As String
  9. cmd = New OleDbCommand
  10. cmd.CommandType = CommandType.Text
  11. cmd.Connection = Connection
  12. If Tnama.Text = "" Or Tpass.Text = "" Then
  13. MsgBox("mangga isian hela ! ")
  14. Tnama.Focus()
  15. Exit Sub
  16. Else
  17. 'Call openConnection()
  18. str = "select * from user where username='" & Tnama.Text & "' and password='" & Tpass.Text & "' "
  19. cmd.CommandText = str
  20. dr = cmd.ExecuteReader()
  21. dr.Read()
  22. If dr.HasRows Then
  23. menuUtama.Show()
  24. Me.Visible = False
  25. Else
  26. MsgBox("Username atau Password salah !")
  27. End If
  28. End If
  29. Connection.Close()
  30. cmd.Dispose()
  31. End Sub
  32.  
  33. Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  34.  
  35. End Sub
  36. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement