Advertisement
Guest User

Untitled

a guest
May 12th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. Dim conn As ADODB.Connection
  2. Dim admin As ADODB.Recordset
  3. Dim adm As String
  4.  
  5. Private Sub Command2_Click()
  6. conn.Execute "INSERT INTO records(username,TimeIn) values('" & Text1 & "','" & Text3 & "')"
  7. End Sub
  8.  
  9. Private Sub Form_Load()
  10. connserver
  11. End Sub
  12. Private Sub connserver()
  13. Set conn = New ADODB.Connection
  14. conn.Open "Driver={MySQL ODBC 5.1 Driver};SERVER=localhost;DATABASE=alps;USER=root;PASSWORD=;OPTION=3"
  15. Set admin = New ADODB.Recordset
  16. End Sub
  17. Private Sub Command1_Click()
  18. Dim adm As String
  19. admin.CursorLocation = adUseServer
  20. adm = "select * from employees where username = '" & Text1.Text & "' and password = '" & Text2.Text & "'"
  21. admin.Open adm, conn
  22. If admin.EOF = False Then
  23. MsgBox "Authorized Personnel!"
  24. Else
  25. MsgBox "Unauthorized Personnel!"
  26. End If
  27. admin.Close
  28. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement