📄 登录.frm
字号:
VERSION 5.00
Object = "{8E27C92E-1264-101C-8A2F-040224009C02}#7.0#0"; "MSCAL.OCX"
Begin VB.Form Form5
BackColor = &H00E0E0E0&
Caption = "登录"
ClientHeight = 3000
ClientLeft = 60
ClientTop = 420
ClientWidth = 4785
LinkTopic = "Form5"
Picture = "登录.frx":0000
ScaleHeight = 3000
ScaleWidth = 4785
StartUpPosition = 3 '窗口缺省
Begin MSACAL.Calendar Calendar1
Height = 1815
Left = 120
TabIndex = 4
Top = 120
Width = 4455
_Version = 524288
_ExtentX = 7858
_ExtentY = 3201
_StockProps = 1
BackColor = 16776960
Year = 2008
Month = 6
Day = 7
DayLength = 1
MonthLength = 1
DayFontColor = 0
FirstDay = 7
GridCellEffect = 1
GridFontColor = 10485760
GridLinesColor = -2147483632
ShowDateSelectors= -1 'True
ShowDays = -1 'True
ShowHorizontalGrid= -1 'True
ShowTitle = -1 'True
ShowVerticalGrid= -1 'True
TitleFontColor = 255
ValueIsNull = 0 'False
BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.TextBox Text2
Height = 270
IMEMode = 3 'DISABLE
Left = 3120
PasswordChar = "*"
TabIndex = 3
Top = 2040
Width = 1335
End
Begin VB.TextBox Text1
Height = 270
Left = 1200
TabIndex = 2
Top = 2040
Width = 1215
End
Begin VB.CommandButton Command2
BackColor = &H00E0E0E0&
Caption = "取消"
Height = 255
Left = 3480
Style = 1 'Graphical
TabIndex = 1
Top = 2400
Width = 735
End
Begin VB.CommandButton Command1
BackColor = &H00E0E0E0&
Caption = "确认"
Height = 255
Left = 2520
Style = 1 'Graphical
TabIndex = 0
Top = 2400
Width = 735
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As ADODB.Recordset
Private Sub Command1_Click()
Dim name As String
Dim str As String
Dim str1 As String
Dim password As String
Set rs = New ADODB.Recordset
name = Trim(Text1.Text)
str = "当前用户: " & name
password = Trim(Text2.Text)
rs.CursorLocation = adUseClient
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "请输入完整信息!", , "库存管理系统"
Else
sql = "select * from 用户信息 where 用户名='" & name & "'"
rs.Open sql, conn, 1, 3
End If
If rs.BOF = True And rs.EOF = True Then
MsgBox "没有此用户信息", , "库存管理系统"
Text1.Text = ""
Text2.Text = ""
Else
If password <> rs.Fields(1).Value Then
MsgBox "密码错误!请重新填写!", , "库存管理系统"
Text2.Text = ""
Else
MsgBox "恭喜!登录成功!哈!哈!哈!!!!!!!!!", , "库存管理系统"
str1 = "权限: " & rs.Fields(2).Value
Form6.Show
Form6.Label1.Caption = str
Form6.Label2.Caption = str1
Form5.Hide
quanxian = rs.Fields(2).Value
username = rs.Fields(0).Value
If rs.Fields(2).Value = "普通用户" Then
MsgBox "普通用户登录!只能管理本用户信息!", , "库存管理系统"
Form6.addordel.Enabled = False
Form6.userinfo.Enabled = False
Form8.Command3.Enabled = False
Form8.Command4.Enabled = False
Form8.Command5.Enabled = False
Form14.Command1.Enabled = False
Form14.Command2.Enabled = False
Form14.Command3.Enabled = False
Form16.Command1.Enabled = False
Form16.Command2.Enabled = False
Form16.Command3.Enabled = False
Form12.Text1.Text = rs.Fields(0).Value
Form12.Text1.Enabled = False
Else
If rs.Fields(2).Value = "管理员" Then
Form6.addordel.Enabled = True
Form6.userinfo.Enabled = True
Form8.Command3.Enabled = True
Form8.Command4.Enabled = True
Form8.Command5.Enabled = True
Form14.Command1.Enabled = True
Form14.Command2.Enabled = True
Form14.Command3.Enabled = True
Form16.Command1.Enabled = True
Form16.Command2.Enabled = True
Form16.Command3.Enabled = True
Form12.Text1.Text = ""
Form12.Text1.Enabled = True
End If
End If
End If
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Set rs = New ADODB.Recordset
Set conn = New ADODB.Connection
conn.ConnectionString = "Provider=SQLOLEDB.1;password=huangtao;User ID=huangtao;Initial Catalog=canku"
conn.Open
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -