📄 form43.frm
字号:
VERSION 5.00
Begin VB.Form Form43
BorderStyle = 0 'None
Caption = "Form43"
ClientHeight = 3750
ClientLeft = 0
ClientTop = 0
ClientWidth = 6000
LinkTopic = "Form43"
Picture = "Form43.frx":0000
ScaleHeight = 3750
ScaleWidth = 6000
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton AddNew
BackColor = &H00FFFFFF&
Caption = "Change"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2040
Style = 1 'Graphical
TabIndex = 9
Top = 2880
Width = 1335
End
Begin VB.CommandButton Cancel
BackColor = &H00FFFFFF&
Caption = "Cancel"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3360
Style = 1 'Graphical
TabIndex = 8
Top = 2880
Width = 1455
End
Begin VB.TextBox cpwd
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
IMEMode = 3 'DISABLE
Left = 2640
MaxLength = 15
PasswordChar = "*"
TabIndex = 3
Top = 2220
Width = 2175
End
Begin VB.TextBox TxtPassword
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
IMEMode = 3 'DISABLE
Left = 2640
MaxLength = 15
PasswordChar = "*"
TabIndex = 2
Top = 1800
Width = 2175
End
Begin VB.TextBox TexUserID
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 2640
Locked = -1 'True
MaxLength = 15
TabIndex = 1
Top = 960
Width = 2175
End
Begin VB.TextBox opwd
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
IMEMode = 3 'DISABLE
Left = 2640
MaxLength = 15
PasswordChar = "*"
TabIndex = 0
Top = 1360
Width = 2175
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = " Change Password"
BeginProperty Font
Name = "Times New Roman"
Size = 21.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 495
Left = 720
TabIndex = 11
Top = 120
Width = 4335
End
Begin VB.Label Label5
BackColor = &H00FF8080&
Height = 615
Left = 120
TabIndex = 10
Top = 0
Width = 5655
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "Confirm Pwd :"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 255
Left = 480
TabIndex = 7
Top = 2220
Width = 1455
End
Begin VB.Label lblUser
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "User ID :"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 285
Left = 360
TabIndex = 6
Top = 975
Width = 1515
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00000080&
BackStyle = 0 'Transparent
Caption = "New Password :"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 285
Left = 480
TabIndex = 5
Top = 1800
Width = 1650
End
Begin VB.Label Label3
AutoSize = -1 'True
BackColor = &H00000080&
BackStyle = 0 'Transparent
Caption = "Old Password :"
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 285
Left = 480
TabIndex = 4
Top = 1360
Width = 1560
End
End
Attribute VB_Name = "Form43"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
End Sub
Private Sub AddNew_Click()
If TexUserID.Text = "" Then
MsgBox "Please Enter The User ID"
TexUserID.SetFocus
Exit Sub
End If
If TxtPassword.Text = "" Then
MsgBox "Please Enter The PassWord"
TxtPassword.SetFocus
Exit Sub
End If
If cpwd.Text = "" Then
MsgBox "Please Confirm The PassWord"
cpwd.SetFocus
Exit Sub
End If
Dim RsLogin As New ADODB.Recordset
If RsLogin.State = adStateOpen Then RsLogin.Close
RsLogin.Open "select * from Login where UserId='" & Val(Trim(TexUserID.Text)) & "'", cnn, adOpenStatic, adLockOptimistic
If RsLogin.RecordCount = 0 Then
MsgBox "Invalid User Id.", vbExclamation + vbOKOnly, "Alert"
TexUserID.SetFocus
RsLogin.Close
Exit Sub
Else
If Trim(RsLogin.Fields("UserPassword")) <> Trim(opwd.Text) Then
MsgBox "Wrong Old Pwd"
Exit Sub
End If
If Trim(TxtPassword.Text) <> Trim(cpwd.Text) Then
MsgBox "Please Confirm The PWD"
Exit Sub
Else
With RsLogin
.Fields("UserId") = Trim(TexUserID.Text)
.Fields("UserPassword") = Trim(TxtPassword.Text)
.Update
End With
End If
MsgBox "Password Changed successfully "
TxtPassword.Text = ""
cpwd.Text = ""
opwd.Text = ""
TexUserID.SetFocus
Exit Sub
'Else
'Unload Me
End If
'End If
End Sub
Private Sub Cancel_Click()
'Adminform.Enabled = True
Unload Me
End Sub
Private Sub Cmbusertype_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Form_Load()
If cnn.State = adStateOpen Then cnn.Close
cnn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=hussain"
TexUserID.Text = Val(VUserId)
End Sub
Private Sub TexUserID_Change()
If Not ((KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8) Then
KeyAscii = 0
End If
If KeyAscii = 13 Then
TexUserID.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -