i got other form log out button that go to this log in form to login again
when i login again it will pop up this error:
operation is not allowed when the object is open
Expand|Select|Wrap|Line Numbers
- Dim intFounds As String
- strCNString = "Data Source=" & App.Path & "\PayrollBakeryDB.mdb"
- cn.Provider = "Microsoft Jet 4.0 OLE DB Provider"
- cn.ConnectionString = strCNString
- cn.Open
- intFounds = 2
- With rs
- .Open "SELECT s_username,s_password,m_username,m_password,b_username,b_password FROM Employees", cn, adOpenDynamic, adLockOptimistic
- Do Until .EOF
- If txtname.Text = !b_username And txtpass.Text = !b_password Then
- intFounds = 1
- P_BossMenu.Show
- Exit Sub
- ElseIf txtname.Text = !m_username And txtpass.Text = !m_password Then
- intFounds = 1
- P_ManagerMenu.Show
- Exit Sub
- ElseIf txtname.Text = !s_username And txtpass.Text = !s_password Then
- intFounds = 1
- P_StaffMenu.Show
- Exit Sub
- End If
- .MoveNext
- Loop
- .MoveFirst
- If intFounds = 2 Then
- MsgBox "Wrong username or password", vbExclamation, "Search"
- End If
- End With
- cn.Close