📄 mmform.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form MMFORM
BorderStyle = 1 'Fixed Single
Caption = "用户密码、专人使用"
ClientHeight = 4020
ClientLeft = 45
ClientTop = 435
ClientWidth = 6030
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "MMFORM.frx":0000
ScaleHeight = 4020
ScaleWidth = 6030
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox Text3
Height = 375
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 6
Top = 2160
Width = 2175
End
Begin VB.CommandButton Command4
Caption = "确定"
Height = 375
Left = 2520
TabIndex = 5
Top = 3120
Width = 975
End
Begin VB.TextBox Text2
DataField = "密码"
DataSource = "Data1"
Height = 375
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 1
Top = 1560
Width = 2175
End
Begin VB.TextBox Text1
DataField = "用户名"
DataSource = "Data1"
Height = 375
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 0
Top = 960
Width = 2175
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 2160
Top = 2640
Visible = 0 'False
Width = 1560
_ExtentX = 2752
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=travaldb;Data Source=zhangwei"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=travaldb;Data Source=zhangwei"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "密码表"
Caption = "密码表"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "新密码确认"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0FFC0&
Height = 375
Left = 1080
TabIndex = 7
Top = 2280
Width = 1095
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "新密码"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0FFC0&
Height = 255
Left = 1320
TabIndex = 4
Top = 1560
Width = 735
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "旧密码"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0FFC0&
Height = 375
Left = 1320
TabIndex = 3
Top = 960
Width = 735
End
Begin VB.Label Label1
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 = &H00C0FFC0&
Height = 495
Left = 1560
TabIndex = 2
Top = 240
Width = 3135
End
End
Attribute VB_Name = "MMFORM"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command4_Click()
Set db = New ADODB.Connection
Set rs = New ADODB.Recordset
db.ConnectionString = "driver={SQL Server};server=zhangwei;database=travaldb"
db.Open
rs.Open "select * from 密码表", db, 3, 3
If Trim(rs("密码")) = Trim(Text1.Text) Then
If Text2.Text = Text3.Text And Len(Text2.Text) > 0 Then
rs("密码") = Text2.Text
rs.Update
MsgBox ("密码修改成功")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Me.Hide
Else
MsgBox ("请保持两次输入的新密码相同")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End If
Else
MsgBox ("请输入正确的旧密码")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End If
rs.Close
End Sub
Private Sub Command2_Click()
Me.Hide
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -