📄 setcode.frm
字号:
VERSION 5.00
Object = "{E95A2510-F3D1-416D-823B-4F840FE98091}#3.0#0"; "COMMAND.OCX"
Begin VB.Form SetCode
Caption = "友情强档——修改密码"
ClientHeight = 3690
ClientLeft = 60
ClientTop = 345
ClientWidth = 3270
Icon = "SetCode.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "SetCode.frx":030A
ScaleHeight = 3690
ScaleWidth = 3270
StartUpPosition = 3 '窗口缺省
Begin CSCommand.Command cmdQd
Height = 375
Index = 0
Left = 240
TabIndex = 5
Top = 2760
Width = 975
_ExtentX = 1720
_ExtentY = 661
Icon = "SetCode.frx":7451
Caption = "&确定"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Appearance = 2
BackStyle = 0
End
Begin VB.TextBox Text2
Height = 270
Left = 1320
TabIndex = 4
Top = 1920
Width = 1335
End
Begin VB.TextBox Text1
Height = 270
Left = 1320
TabIndex = 3
Top = 1080
Width = 1335
End
Begin CSCommand.Command cmdCancel
Height = 375
Index = 1
Left = 2040
TabIndex = 6
Top = 2760
Width = 975
_ExtentX = 1720
_ExtentY = 661
Icon = "SetCode.frx":776B
Caption = "&取消"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Appearance = 2
BackStyle = 0
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "新密码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FF00&
Height = 210
Left = 360
TabIndex = 2
Top = 1920
Width = 810
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户名:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FF00&
Height = 210
Left = 360
TabIndex = 1
Top = 1080
Width = 810
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "修改密码"
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000FF00&
Height = 435
Left = 720
TabIndex = 0
Top = 240
Width = 1815
End
End
Attribute VB_Name = "SetCode"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Fr_Str As ADODB.Recordset
Dim Fr_Cnn As ADODB.Recordset
Dim Cnt As String '用户名
Dim Num As String '新密码
Dim Cnd As Boolean
Private Sub cmdCancel_Click(Index As Integer)
Unload Me
End Sub
Private Sub cmdQd_Click(Index As Integer)
If Fr_Str.RecordCount <= 0 Then Exit Sub
If Fr_Cnn.RecordCount <= 0 Then Exit Sub
If Trim(Text1.Text) = "" Then
MsgBox "用户名不能为空,请输入您所要修改密码的用户名!", vbOKOnly + vbExclamation, "友情—密码约束"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Exit Sub
End If
If Fr_Str.EOF = True And Fr_Str.BOF - True Then
MsgBox "没有此用户,请查证后再次修改密码!", vbOKOnly + vbExclamation, "友情—密码约束"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
Cnd = True
End If
If Cnd = True Then
Fr_Str(0) = Trim(Text1.Text)
Fr_Str(1) = Trim(Text2.Text)
Fr_Str.Update
MsgBox "修改密码成功!", vbOKOnly + vbExclamation, "友情—密码修改"
Cnd = False
Unload Me
End If
End Sub
Private Sub Form_Load()
Set Fr_Str = New ADODB.Recordset
Set Fr_Cnn = New ADODB.Recordset
Cnt = "Select * From Consumer"
Fr_Str.Open Cnt, cnFriend, adOpenKeyset, adLockOptimistic, adCmdText
Num = "Select * From consumer"
Fr_Cnn.Open Num, cnFriend, adOpenKeyset, adLockOptimistic, adCmdText
Cnd = False
Fr_Str.Fields(0) = Text1.Text
Fr_Str.Fields(1) = Text2.Text
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -