📄 frmaskwho.frm
字号:
VERSION 5.00
Begin VB.Form frmAskWho
BorderStyle = 1 'Fixed Single
Caption = "确认操作员权限"
ClientHeight = 1590
ClientLeft = 45
ClientTop = 330
ClientWidth = 3360
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1590
ScaleWidth = 3360
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox txtID
Height = 285
Left = 1560
TabIndex = 0
Top = 120
Width = 1575
End
Begin VB.TextBox txtPWD
Height = 285
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 1
Top = 480
Width = 1575
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消 "
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 1785
TabIndex = 3
Top = 1080
Width = 1110
End
Begin VB.CommandButton cmdOK
Caption = "确定 "
Default = -1 'True
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 390
TabIndex = 2
Top = 1065
Width = 1065
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "操作员名:"
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 5
Top = 120
Width = 1215
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "口令:"
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 4
Top = 480
Width = 1215
End
End
Attribute VB_Name = "frmAskWho"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2007/07/09
'描 述:CBB三表户外计量系统 Ver 5.2
'网 站:http://www.Mndsoft.com/ (VB6源码博客)
'网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Private Declare Sub InitCommonControls Lib "comctl32.dll" ()
Private Sub Form_Initialize()
InitCommonControls
End Sub
Private Sub cmdCancel_Click()
Unload frmAskWho
If OPThen = 3 Then
End
End If
End Sub
Private Sub cmdOK_Click()
'On Error GoTo ProcError
Dim rcOP As Recordset
Dim temStr As String
Dim rcsuper As Recordset
temStr = UCase(Trim(txtID.Text))
If temStr = "" Then
Exit Sub
Else
If temStr = "SUPER" Then
Set rcsuper = dbCbb.OpenRecordset("super", dbOpenSnapshot)
If Not rcsuper.EOF Then
If Trim(rcsuper!Password) <> Trim(txtPWD.Text) Then
GoTo Invalid
Else
curOP = temStr
'询问口令后的操作(用于决定在询问口令"frmAskWho"后,
'设置什么,1---frmOP.show, 2---frmSuper.show,3---frmMain.show)
Select Case OPThen
Case 1
GoTo Pass
Case 2
Unload frmAskWho
frmSuper.Show
Exit Sub
Case 3
curOP = temStr
curPassword = Trim(rcsuper!Password)
Unload frmAskWho
frmMain.Show
Exit Sub
Case 4
Unload frmAskWho
frmGetInSet.Show
Exit Sub
End Select
End If
End If
Set rcsuper = Nothing
End If
Set rcOP = dbCbb.OpenRecordset("OPMap", dbOpenSnapshot)
If rcOP.EOF Then
MsgBox "还未分配任何操作员" + Chr(10) + "请系统管理员分配相应的操作员", , "确认权限"
txtID.SetFocus
txtID.SelStart = 0
txtID.SelLength = Len(txtID.Text)
Exit Sub
Else
rcOP.FindFirst "ucase(trim(ID))=""" + temStr + """ and Password=""" + Trim(txtPWD.Text) + """"
curPassword = Trim(txtPWD.Text)
If rcOP.NoMatch Then
GoTo Invalid
Else
GoTo Pass
End If
End If
Set rcOP = Nothing
End If
Exit Sub
Invalid:
MsgBox "操作员名或口令不正确" + Chr(10) + "请重新输入", , "确认权限"
txtID.SetFocus
txtID.SelStart = 0
txtID.SelLength = Len(txtID.Text)
Exit Sub
Pass:
Unload frmAskWho
Select Case OPThen
Case 1
frmOP.Show
Case 3
curOP = temStr
Unload frmAskWho
frmMain.Show
Exit Sub
End Select
Exit Sub
ProcError:
ProcErr
End Sub
Private Sub Form_Load()
If UBound(curForm) > 0 Then
curForm(UBound(curForm)).Enabled = False
End If
ReDim Preserve curForm(UBound(curForm) + 1)
Set curForm(UBound(curForm)) = Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
ReDim Preserve curForm(UBound(curForm) - 1)
If UBound(curForm) > 0 Then
curForm(UBound(curForm)).Enabled = True
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -