home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmPassWord
- BackColor = &H00C0C0C0&
- BorderStyle = 3 'Fixed Double
- Caption = "Enter ID & Password"
- ClientHeight = 1572
- ClientLeft = 3768
- ClientTop = 2028
- ClientWidth = 4032
- ClipControls = 0 'False
- ControlBox = 0 'False
- Height = 1992
- Left = 3720
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1572
- ScaleWidth = 4032
- Top = 1656
- Width = 4128
- Begin TextBox txtID
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 7.8
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 336
- Left = 360
- TabIndex = 0
- Top = 240
- Width = 1692
- End
- Begin CommandButton cmdCancel
- Caption = "Cancel"
- Height = 372
- Left = 2760
- TabIndex = 4
- Top = 840
- Width = 972
- End
- Begin CommandButton cmdOK
- Caption = "OK"
- Default = -1 'True
- Height = 372
- Left = 2760
- TabIndex = 3
- Top = 240
- Width = 972
- End
- Begin TextBox txtPwd
- Height = 336
- Left = 360
- PasswordChar = "*"
- TabIndex = 1
- Top = 840
- Width = 1692
- End
- Begin Label lblPwd
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- Height = 192
- Left = 360
- TabIndex = 6
- Top = 1320
- Width = 60
- End
- Begin Label Label1
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- Caption = "Enter your User ID:"
- Height = 192
- Index = 1
- Left = 360
- TabIndex = 5
- Top = 0
- Width = 1572
- End
- Begin Label Label1
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- Caption = "Enter your password:"
- Height = 192
- Index = 0
- Left = 360
- TabIndex = 2
- Top = 600
- Width = 1752
- End
- Option Explicit
- Sub cmdCancel_Click ()
- End
- End Sub
- Sub cmdOk_Click ()
- Dim daysleft As Integer 'for expiration calc
- If txtID.Text = "" Then 'both required
- txtID.SetFocus
- Beep
- lblPwd.Caption = "User ID is required."
- Exit Sub
- ElseIf txtPwd.Text = "" Then
- txtPwd.SetFocus
- Beep
- lblPwd.Caption = "User Password is required."
- Exit Sub
- End If
- 'number of times tried entering password
- Static Tries As Integer
- Tries = Tries + 1
- UserID = UCase$(txtID.Text)
- Call ReadPasswd(True, UserID)
- If UCase$(txtPwd.Text) = PassWord Then 'got it
- Unload frmPassWord
- daysleft = DateDiff("d", Now, UserExpireDate)
- If daysleft < 1 Then
- Beep
- MsgBox "Your password has expired. You will have to change it.", 42, "Expired User"
- frmChgPassWord.Show MODAL
- End If
- Exit Sub
- ElseIf Tries >= NUM_TRIES Then 'nope, otta hear.
- MsgBox "ACCESS DENIED", 16, "Password"
- End
- End If
- 'incorrect
- MsgBox "Invalid password - please try again", 48, "Password"
- txtPwd.Text = ""
- txtPwd.SetFocus
- End Sub
- Sub Form_Load ()
- ' Look for the encrypted password file. If not found, set the PassWord
- ' to the default "COMPUTER"
- Call FormCenterModal(Me)
- End Sub
- Sub Form_Unload (Cancel As Integer)
- Set frmPassWord = Nothing
- End Sub
- Sub txtID_KeyPress (KeyAscii As Integer)
- If KeyAscii = 13 Then 'enter key
- SendKeys "{Tab}"
- KeyAscii = 0
- End If
- End Sub
- Sub txtPwd_KeyPress (KeyAscii As Integer)
- If KeyAscii = 13 Then 'enter key
- SendKeys "{Tab}"
- KeyAscii = 0
- End If
- End Sub
-