Expand|Select|Wrap|Line Numbers
- Private Sub Command1_Click()
- Set conn = New ADODB.Connection
- conn.CursorLocation = adUseClient
- conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\VB98\professor_data.mdb;Persist Security Info=False;"
- conn.Open
- Set rs = New ADODB.Recordset
- With rs
- Set .ActiveConnection = conn
- .CursorType = adOpenDynamic
- .LockType = adLockOptimistic
- .Source = "select * from professor_data"
- .Open
- If rs.RecordCount <> 0 Then
- rs.MoveFirst
- While Not rs.EOF
- If ((rs.Fields(0) = username.Text) And (rs.Fields(1) = password.Text)) Then
- MsgBox "SUCCESFUL LOGIN "
- Form1.Show
- Else
- MsgBox "INVALID USER"
- End If
- rs.MoveNext
- Wend
- End If
- End With
- rs.Close
- Set rs = Nothing
- End Sub