📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BackColor = &H00000000&
BorderStyle = 3 'Fixed Dialog
Caption = "Login"
ClientHeight = 1545
ClientLeft = 2835
ClientTop = 3480
ClientWidth = 3990
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 912.837
ScaleMode = 0 'User
ScaleWidth = 3746.394
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "initialsc.mdb"
DefaultCursorType= 0 'DefaultCursor
DefaultType = 2 'UseODBC
Exclusive = 0 'False
Height = 300
Left = 1440
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "initials"
Top = 600
Visible = 0 'False
Width = 1140
End
Begin VB.TextBox txtUserName
Height = 345
Left = 1290
TabIndex = 1
Top = 135
Width = 2325
End
Begin VB.CommandButton cmdOK
Caption = "OK"
Default = -1 'True
Height = 390
Left = 1200
TabIndex = 4
Top = 1020
Width = 1140
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "Cancel"
Height = 390
Left = 2340
TabIndex = 5
Top = 1020
Width = 1140
End
Begin VB.TextBox txtPassword
Height = 345
IMEMode = 3 'DISABLE
Left = 1290
PasswordChar = "*"
TabIndex = 3
Top = 525
Width = 2325
End
Begin VB.Data logindata
Caption = "Data1"
Connect = "Access"
DatabaseName = "app.path & ""initialsc.mdb"""
DefaultCursorType= 0 'DefaultCursor
DefaultType = 2 'UseODBC
Exclusive = 0 'False
Height = 300
Left = 0
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "Usersinfo"
Top = 1080
Visible = 0 'False
Width = 1065
End
Begin VB.Label lblLabels
BackColor = &H80000012&
Caption = "&User Name:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 270
Index = 0
Left = 105
TabIndex = 0
Top = 150
Width = 1080
End
Begin VB.Label lblLabels
BackColor = &H80000012&
Caption = "&Password:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 270
Index = 1
Left = 105
TabIndex = 2
Top = 540
Width = 1080
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'This library project is created by Vipin Panicker. E-Mail: itsvipin@hotmail.com
Private Sub cmdCancel_Click()
Dim i As Byte
Beep
i = MsgBox("You want to exit this Application", vbYesNo, "Exit Application")
If i = vbYes Then
End
End If
End Sub
Private Sub cmdOK_Click()
logindata.Recordset.FindFirst ("tuserid='" + txtusername.Text + "'")
If Not logindata.Recordset.NoMatch Then
If txtPassword.Text = logindata.Recordset.Fields("tpassword") Then
Me.Visible = False
Main.Show
Else
i = MsgBox("Enter correct password.", vbOKOnly, "Incorrect Password")
End If
Else
MsgBox "Either User name or Password is incorrect or ask your system administrator for further details."
End If
End Sub
Private Sub Form_Load()
logindata.DatabaseName = App.Path & "\initialsc.mdb"
End Sub
Private Sub Form_Unload(Cancel As Integer)
'i = MsgBox("You want to exit this Application", vbYesNo, "Exit Application")
If Cancel = 0 Then
i = MsgBox("You want to exit this Application", vbYesNo, "Exit Application")
If i = vbYes Then
End
Else
Cancel = 1
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -