?? frm_login.frm
字號:
VERSION 5.00
Begin VB.Form Frm_Login
BackColor = &H00C0DCC0&
Caption = "NewAsia考勤異常確認(rèn)"
ClientHeight = 3990
ClientLeft = 60
ClientTop = 345
ClientWidth = 7095
ControlBox = 0 'False
LinkTopic = "Form1"
ScaleHeight = 3990
ScaleWidth = 7095
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command1
Caption = "確定"
Height = 500
Index = 0
Left = 2400
Picture = "Frm_Login.frx":0000
Style = 1 'Graphical
TabIndex = 3
Top = 3240
Width = 735
End
Begin VB.CommandButton Command1
Caption = "退出"
Height = 500
Index = 1
Left = 4080
Picture = "Frm_Login.frx":00F2
Style = 1 'Graphical
TabIndex = 6
Top = 3240
Width = 735
End
Begin VB.TextBox txtPassword
Height = 345
IMEMode = 3 'DISABLE
Left = 2865
PasswordChar = "*"
TabIndex = 2
Top = 2310
Width = 2325
End
Begin VB.TextBox txtUserName
Height = 345
Left = 2865
TabIndex = 1
Top = 1920
Width = 2325
End
Begin VB.Label lblLabels
BackColor = &H00C0DCC0&
Caption = "密碼:"
Height = 270
Index = 1
Left = 1680
TabIndex = 5
Top = 2325
Width = 1080
End
Begin VB.Label lblLabels
BackColor = &H00C0DCC0&
Caption = "用戶工號:"
Height = 270
Index = 0
Left = 1680
TabIndex = 4
Top = 1935
Width = 1080
End
Begin VB.Label Label2
BackColor = &H00C0DCC0&
Caption = "NewAsia考勤異常確認(rèn)"
BeginProperty Font
Name = "華文彩云"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 735
Left = 840
TabIndex = 0
Top = 600
Width = 5415
End
End
Attribute VB_Name = "Frm_Login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim mDB As mDB
Dim strSQL As String
Private adoprimaryRS As ADODB.Recordset
Private strSQL2 As String
Private adoPrimaryRS2 As ADODB.Recordset
Private Sub Command1_Click(Index As Integer)
Static i As Integer
Select Case Index
Case 0
If txtUserName.Text = "" Then End
'On Error Resume Next
If txtUserName.Text = "" And txtPassword.Text = "" Then
Unload Me
End If
If adoPrimaryRS2.Fields("oper_pass").Value = Encypt.Decode_Pass(txtPassword.Text) Then
emplyid = adoPrimaryRS2.Fields("emplyid").Value
OperID = emplyid
UserName = adoPrimaryRS2.Fields("oper_name").Value
InsertDengLeLog OperID, UserName, "KaoQinQR" '''App.Title
Frm_Rpt_KaoQinYC.Show
Unload Me
Else
i = i + 1
If i > 3 Then End
MsgBox "無效的密碼,請重試!", , "登錄"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
Case 1
Unload Me
End
End Select
End Sub
Private Sub Form_Load()
Dim sConn As String
Dim sServer As String
Dim sDatasourceName As String
Dim sUser As String
'On Error Resume Next
On Error GoTo Err1
Dim o As New iniFunc
sServer = o.sGetINI(App.Path & "\SQLnewasia.ini", "setting", "Server Name", "zjxy")
sDatasourceName = o.sGetINI(App.Path & "\SQLnewasia.ini", "setting", "DATABASE NAME", "xinya")
sUser = o.sGetINI(App.Path & "\SQLnewasia.ini", "setting", "User Name", "reformer")
Set o = Nothing
sConn = "Provider=SQLOLEDB.2;Persist Security Info=True;SERVER=" & sServer & ";User ID=" & sUser & ";Password=5148936;DataBase=" & sDatasourceName
Set mDB = New mDB
mDB.InitDB_RY sConn
strSQL2 = "select * from hOperator"
Set adoPrimaryRS2 = mDB.adoprimaryRS(strSQL2)
Exit Sub
Err1:
MsgBox sServer & ";" & sDatasourceName & ";" & sUser & ";不正確。"
End Sub
Private Sub txtPassword_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
KeyCode = 0
SendKeys vbTab
End If
End Sub
Private Sub txtUserName_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
KeyCode = 0
SendKeys vbTab
End If
End Sub
Private Sub txtUserName_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = vbKeyTab
End If
End Sub
Private Sub txtUserName_LostFocus()
Dim i As Integer
If txtUserName.Text = "" Then Exit Sub
'' strSQL = "select * from operater where operid='" & txtUserName.Text & "'"
' strSQL = "select * from hoper where oper_ID='" & txtUserName.Text & "'"
''Database_Refresh 0
'Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
'
' If adoprimaryRS.RecordCount < 1 Then
' If txtUserName.Text = "" Then
' Call cmdOk_Click
' End If
'
' MsgBox "用戶名錯誤!"
' txtUserName.Text = ""
' txtUserName.SetFocus
' Else
' txtPassword.SetFocus
' End If
'
'If DataCombo1.Text <> "" Then
With adoPrimaryRS2
.Find "emplyid='" & txtUserName.Text & "'", 0, adSearchForward, adBookmarkFirst
If .EOF Then
i = i + 1
If i > 1 Then Exit Sub
MsgBox "用戶不存在。"
txtUserName.SetFocus
SendKeys "{home}+{end}"
Exit Sub
Else
.Filter = "emplyid='" & txtUserName.Text & "'"
'''''''新用戶設(shè)置密碼;
If IsNull(.Fields("oper_pass").Value) Or .Fields("oper_pass").Value = "" Then
MsgBox "你是第一次使用本系統(tǒng)的新用戶,請先設(shè)置好的密碼,請記好,別忘記了啊!"
Dim tmpMM As String
Dim tmpS1 As String
Dim tmpS2 As String
With sForm
.MiMa_SZ
tmpS1 = .GetFindVar1
tmpS2 = .GetFindVar2
End With
If tmpS1 = tmpS2 And tmpS1 <> "" Then
tmpMM = Encypt.Decode_Pass(tmpS1)
.Fields("oper_pass").Value = tmpMM
.Update
Else
Exit Sub
End If
''''''''''''''\\\\\\\\\\\\\\\\\\\\\\\\\\\
Else
' If .Fields("oper_pass").Value = Encypt.UnCode_Pass(txtPassword.Text) Then
' Else
' MsgBox "密碼無效。請再試一次。"
' End If
End If
End If
End With
'End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -