?? frm_sfyz.frm
字號(hào):
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frm_sfyz
Caption = "初始化數(shù)據(jù)身份驗(yàn)證"
ClientHeight = 1725
ClientLeft = 60
ClientTop = 345
ClientWidth = 3390
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 1725
ScaleWidth = 3390
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "取消"
Height = 350
Left = 2480
TabIndex = 6
Top = 1350
Width = 855
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 350
Left = 1640
TabIndex = 5
Top = 1350
Width = 855
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 240
Top = 2160
Width = 1935
_ExtentX = 3413
_ExtentY = 661
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 = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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.Frame Frame1
Height = 1215
Left = 80
TabIndex = 0
Top = 60
Width = 3255
Begin VB.TextBox Text2
Height = 350
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 4
Top = 720
Width = 1575
End
Begin VB.TextBox Text1
Height = 350
Left = 1440
Locked = -1 'True
TabIndex = 3
Top = 240
Width = 1575
End
Begin VB.Label Label2
Caption = "操作員口令"
Height = 255
Left = 240
TabIndex = 2
Top = 840
Width = 975
End
Begin VB.Label Label1
Caption = "操作員姓名"
Height = 375
Left = 240
TabIndex = 1
Top = 360
Width = 1215
End
End
End
Attribute VB_Name = "frm_sfyz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'*** 單擊“確定”按鈕的事件過程 ***
Private Sub Command1_Click()
rtn = SetWindowPos(Me.hwnd, -2, 0, 0, 0, 0, 3) '運(yùn)用API函數(shù)SetWindowPos,來實(shí)現(xiàn)取消窗體置前的功能
If Text1.Text = "Admin" Then '判斷是否使用超級(jí)用戶登錄
If Text2.Text = "ljm2004" Then
Unload Me
frm_del_Data.Show
Else
MsgBox "輸入的密碼不正確!", 48
Text2.Text = ""
Text2.SetFocus
End If
Else '如果不是使用超級(jí)用戶登錄,則到數(shù)據(jù)庫中查找該用戶的信息
Adodc1.RecordSource = "select * from tb_enter where m_name='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
If Text2.Text = Adodc1.Recordset.Fields("M_password") Then '判斷數(shù)據(jù)的密碼是否正確
Unload Me
frm_del_Data.Show
Else
MsgBox "您輸入的密碼不正確,請(qǐng)您確認(rèn)后重新輸入", 48
Text2.Text = "" '如果輸入的密碼不正確,則清空文本框重新輸入
Text2.SetFocus
End If
Else
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Text1.Text = Name1
End Sub
Private Sub Form_Load()
rtn = SetWindowPos(Me.hwnd, -1, 0, 0, 0, 0, 3) '運(yùn)用API函數(shù)SetWindowPos,來實(shí)現(xiàn)使窗體置前的功能
'利用代碼連接數(shù)據(jù)庫
Adodc1.ConnectionString = CnnStr
Adodc1.RecordSource = "select * from tb_enter" '連接操作員信息表
Adodc1.Refresh
Me.Left = (Screen.Width - Me.Width) / 2 '使窗體居中
Me.Top = (Screen.Height - Me.Height) / 2
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call Command1_Click '調(diào)用“確定”按鈕的單擊事件
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True '當(dāng)關(guān)閉窗體的時(shí)候使主窗體變?yōu)榭捎脿顟B(tài)
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -