Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim conn As ADODB.Connection
- Dim admin As ADODB.Recordset
- Dim adm As String
- Private Sub Command2_Click()
- conn.Execute "INSERT INTO records(username,TimeIn) values('" & Text1 & "','" & Text3 & "')"
- End Sub
- Private Sub Form_Load()
- connserver
- End Sub
- Private Sub connserver()
- Set conn = New ADODB.Connection
- conn.Open "Driver={MySQL ODBC 5.1 Driver};SERVER=localhost;DATABASE=alps;USER=root;PASSWORD=;OPTION=3"
- Set admin = New ADODB.Recordset
- End Sub
- Private Sub Command1_Click()
- Dim adm As String
- admin.CursorLocation = adUseServer
- adm = "select * from employees where username = '" & Text1.Text & "' and password = '" & Text2.Text & "'"
- admin.Open adm, conn
- If admin.EOF = False Then
- MsgBox "Authorized Personnel!"
- Else
- MsgBox "Unauthorized Personnel!"
- End If
- admin.Close
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement