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.ConnectionString = "Driver={MySQL ODBC 3.51 Driver};SERVER=localhost;Database=alps;User=root;OPTION=3"
- conn.Open
- End Sub
- Private Sub Command1_Click()
- Dim admin As ADODB.Recordset
- Dim adm As String
- On Error GoTo a
- Set admin = New ADODB.Recordset
- admin.CursorLocation = adUseServer
- adm = "select * from employees where username = '" & Text1.Text & "' and password = '" & Text2.Text & "'"
- admin.Open adm, conn
- Command2.Enabled = True
- Command3.Enabled = True
- Text3.Text = Time
- Exit Sub
- a:
- MsgBox "Unauthorized Personel!"
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement