by Jerome R. Romero (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 2nd June 2008
Date Added: Mon 8th February 2021
Rating:
(1 Votes)
Log-in for software systems.
API Declarations
'please include 2 textboxes, 2 command buttons, 1 frame
'import the component microsoft ADO data control 6.0(OLEDB)
'create simple database using access with 2 fields, the username and password
Adodc1.Recordset.Filter = "Username like '" & Text1.Text & "' and Password like '" & Text2.Text & "'"
If Adodc1.Recordset.RecordCount >= 1 Then
MsgBox "Welcome boss, " & Text1 & ". You are now ready to access the system.."
Unload Me
Else
ctr = ctr + 1
If ctr = 1 Then
MsgBox "Sorry boss, your first attempt to access the system fail. Try again."
Text1 = ""
Text1.SetFocus
ElseIf ctr = 2 Then
MsgBox "Sorry again boss, your second attempt to access the system still fail. Try again."
Text1 = ""
Text1.SetFocus
Else
MsgBox "I'm really sorry boss, you lose the chance to access the system. System will be shutdown."
End
End If
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Form1.BackColor = &H808000
Frame1.BackColor = &HC0C000
Label1.FontBold = True
Label1.FontSize = 10
Label2.FontBold = True
Label2.FontSize = 10
Label1.BackStyle = 0
Label2.BackStyle = 0
Command1.FontBold = True
Command1.FontSize = 10
Command2.FontBold = True
Command2.FontSize = 10
Text1.FontBold = True
Text1.FontSize = 10
Text2.FontBold = True
Text2.FontSize = 10
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Command1.SetFocus
End If
End Sub