📄 frmlogin.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmLogin
BorderStyle = 1 'Fixed Single
Caption = "登录"
ClientHeight = 2550
ClientLeft = 45
ClientTop = 435
ClientWidth = 5160
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "frmLogin.frx":0442
ScaleHeight = 2550
ScaleWidth = 5160
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text3
DataField = "姓名"
DataSource = "Adodc2"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 120
TabIndex = 9
Top = 900
Visible = 0 'False
Width = 1395
End
Begin VB.Frame Frame1
BackColor = &H00FFC0FF&
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1335
Left = 2010
TabIndex = 3
Top = 465
Width = 2655
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
ItemData = "frmLogin.frx":4CFC
Left = 840
List = "frmLogin.frx":4CFE
TabIndex = 0
Top = 405
Width = 1695
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
IMEMode = 3 'DISABLE
Left = 840
PasswordChar = "*"
TabIndex = 1
Top = 795
Width = 1695
End
Begin VB.TextBox Text2
DataField = "密码"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 120
TabIndex = 5
Text = "用来判断密码的"
Top = 105
Visible = 0 'False
Width = 1395
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "操作员:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 7
Top = 480
Width = 735
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "密 码:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 6
Top = 855
Width = 735
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = -90
Top = 480
Visible = 0 'False
Width = 1800
_ExtentX = 3175
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=company"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=company"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 操作用户"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command2
BackColor = &H80000009&
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3570
Style = 1 'Graphical
TabIndex = 4
Top = 2025
Width = 975
End
Begin VB.CommandButton Command1
BackColor = &H80000009&
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2130
Style = 1 'Graphical
TabIndex = 2
Top = 2025
Width = 975
End
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 180
Top = 0
Visible = 0 'False
Width = 1800
_ExtentX = 3175
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=company"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=company"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 操作用户"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "系统用户登录"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 375
Left = 2445
TabIndex = 8
Top = 105
Width = 1935
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
Text1.SetFocus
End If
End Sub
Private Sub Command1_Click()
Adodc1.RecordSource = "select * from 操作用户 where 姓名='" + Trim(Combo1) + "'"
Adodc1.Refresh
If Text3.Text = "" Then
MsgBox "您现在还没有注册系统用户!!!", , "系统提示"
frm_main.Show
frmLogin.Hide
Else
If Combo1.Text = "" Then
MsgBox "请输入用户名!", , "系统提示"
End If
If Adodc1.Recordset.RecordCount > 0 Then
If Trim(Text1.Text) = Trim(Text2.Text) Then
frm_main.Show
frmLogin.Hide
Else
MsgBox "你输入的密码不正确!", vbQuestion, "系统提示"
Text1.Text = ""
Text1.SetFocus
End If
End If
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Activate()
Combo1.SetFocus
Combo1.Text = ""
End Sub
Private Sub Form_Load()
For i = 0 To Adodc1.Recordset.RecordCount - 1 '动态添加combo1
Combo1.AddItem Adodc1.Recordset.Fields("姓名").Value
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then Exit For
Next
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
Command1_Click
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -