?? frmxgmm.frm
字號:
VERSION 5.00
Begin VB.Form frmxgmm
BorderStyle = 1 'Fixed Single
Caption = "興盛牙刷銷存管理系統--修改密碼"
ClientHeight = 3390
ClientLeft = 3690
ClientTop = 2685
ClientWidth = 4680
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3390
ScaleWidth = 4680
Begin VB.CommandButton Command2
Caption = "返 回"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2760
TabIndex = 4
Top = 2760
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "確 認"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 720
TabIndex = 3
Top = 2760
Width = 1095
End
Begin VB.TextBox txtnew
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 2
Top = 2040
Width = 1695
End
Begin VB.TextBox txtuser
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2160
TabIndex = 0
Top = 360
Width = 1695
End
Begin VB.TextBox txtpwd
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 1
Top = 1200
Width = 1695
End
Begin VB.Label Label3
Caption = "新 密 碼:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 7
Top = 2040
Width = 1455
End
Begin VB.Label Label2
Caption = "舊 密 碼:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 6
Top = 1320
Width = 1335
End
Begin VB.Label Label1
Caption = "用 戶 名:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 5
Top = 480
Width = 1335
End
End
Attribute VB_Name = "frmxgmm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
DefaultType = dbUseODBC
Dim db As Database
Dim rs As Recordset
Dim cx As Boolean
cx = False
Set db = OpenDatabase("xsys", dbDriverNoPrompt, False, "odbc;database=glxt;uid=;pwd=;dsn=xsys")
Set rs = db.OpenRecordset("yhk", dbOpenDynaset, dbwrite, dbOptimistic)
Do While rs.EOF <> True
If rs.Fields("用戶名") = LTrim(txtuser.Text) Then
cx = True
Exit Do
End If
If rs.EOF = True Then
Exit Do
End If
rs.MoveNext
Loop
If txtuser.Text = "" Or txtpwd.Text = "" Or txtnew.Text = "" Then
MsgBox "輸入不能為空,請重新填寫!"
Command2.SetFocus
Else
If MsgBox("請確認填寫無誤,否則修改!", vbOKCancel, "提示") = vbOK Then
If cx = False Then
MsgBox "無此用戶,請先分配此用戶!", vbCritical, "提示"
txtuser.SetFocus
Else
If txtpwd.Text = rs.Fields("密碼") Then
With rs
.Edit
.Fields("密碼") = LTrim(txtnew.Text)
.Update
.Close
End With
MsgBox "密碼修改成功!", vbInformation, "提示"
txtuser.Text = ""
txtpwd.Text = ""
txtnew.Text = ""
Else
MsgBox "原密碼不對,請重新輸入!", vbCritical, "錯誤"
txtpwd.Text = ""
txtnew.Text = ""
txtpwd.SetFocus
End If
End If
Else
Command2.SetFocus
End If
End If
db.Close
End Sub
Private Sub Command2_Click()
Unload Me
frmmenu.Show
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
Dim nexttabindex As Integer, i As Integer
If KeyAscii = 13 Then
If Screen.ActiveControl.TabIndex = Count - 1 Then
nexttabindex = 0
Else
nexttabindex = Screen.ActiveControl.TabIndex + 1
End If
For i = 0 To Count - 1
If Me.Controls(i).TabIndex = nexttabindex Then
Me.Controls(i).SetFocus
Exit For
End If
Next i
KeyAscii = 0
End If
End Sub
Private Sub Form_Load()
If frmmenu.fpxyh.Enabled = True Then
txtuser.Text = frmlogin.Combo1.Text
Else
txtuser.Text = frmlogin.Combo1.Text
txtuser.Locked = True
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -