📄 form_consumer.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form Form_Consumer
Caption = "用户管理"
ClientHeight = 4785
ClientLeft = 3870
ClientTop = 2775
ClientWidth = 6015
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4785
ScaleWidth = 6015
Begin MSAdodcLib.Adodc Adodc_user
Height = 375
Left = 720
Top = 4200
Visible = 0 'False
Width = 1335
_ExtentX = 2355
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command_User_Exit
Caption = "退出"
Height = 375
Left = 4080
TabIndex = 14
Top = 4320
Width = 1575
End
Begin TabDlg.SSTab SSTab1
Height = 4095
Left = 120
TabIndex = 0
Top = 120
Width = 5775
_ExtentX = 10186
_ExtentY = 7223
_Version = 393216
Tabs = 2
Tab = 1
TabHeight = 520
TabCaption(0) = "用户密码修改"
TabPicture(0) = "Form_Consumer.frx":0000
Tab(0).ControlEnabled= 0 'False
Tab(0).Control(0)= "Command_UserPwdCancel"
Tab(0).Control(1)= "Command_UserPwd_Change"
Tab(0).Control(2)= "Text_NewUsrPwd_Confirm"
Tab(0).Control(3)= "Text_NewUsrPwd"
Tab(0).Control(4)= "Text_OldUsrPwd"
Tab(0).Control(5)= "Text_CurUser"
Tab(0).Control(6)= "Label4"
Tab(0).Control(7)= "Label3"
Tab(0).Control(8)= "Label2"
Tab(0).Control(9)= "Label1"
Tab(0).ControlCount= 10
TabCaption(1) = "用户管理"
TabPicture(1) = "Form_Consumer.frx":001C
Tab(1).ControlEnabled= -1 'True
Tab(1).Control(0)= "DataGrid_Usr"
Tab(1).Control(0).Enabled= 0 'False
Tab(1).Control(1)= "Command3"
Tab(1).Control(1).Enabled= 0 'False
Tab(1).Control(2)= "Command5"
Tab(1).Control(2).Enabled= 0 'False
Tab(1).ControlCount= 3
Begin VB.CommandButton Command5
Caption = "删除"
Height = 375
Left = 3840
TabIndex = 13
Top = 3600
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "添加"
Height = 375
Left = 2280
TabIndex = 12
Top = 3600
Width = 1215
End
Begin MSDataGridLib.DataGrid DataGrid_Usr
Bindings = "Form_Consumer.frx":0038
Height = 2895
Left = 240
TabIndex = 11
Top = 480
Width = 5295
_ExtentX = 9340
_ExtentY = 5106
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.CommandButton Command_UserPwdCancel
Caption = "取消"
Height = 375
Left = -71040
TabIndex = 10
Top = 3240
Width = 1215
End
Begin VB.CommandButton Command_UserPwd_Change
Caption = "确定"
Height = 375
Left = -72720
TabIndex = 9
Top = 3240
Width = 1215
End
Begin VB.TextBox Text_NewUsrPwd_Confirm
Height = 375
IMEMode = 3 'DISABLE
Left = -72720
PasswordChar = "*"
TabIndex = 7
Top = 2640
Width = 1575
End
Begin VB.TextBox Text_NewUsrPwd
Height = 375
IMEMode = 3 'DISABLE
Left = -72720
PasswordChar = "*"
TabIndex = 5
Top = 2040
Width = 1575
End
Begin VB.TextBox Text_OldUsrPwd
Height = 375
IMEMode = 3 'DISABLE
Left = -72720
PasswordChar = "*"
TabIndex = 3
Top = 1440
Width = 1575
End
Begin VB.TextBox Text_CurUser
Height = 375
Left = -72720
Locked = -1 'True
TabIndex = 2
Top = 840
Width = 1575
End
Begin VB.Label Label4
Caption = "确认密码:"
Height = 375
Left = -74040
TabIndex = 8
Top = 2760
Width = 975
End
Begin VB.Label Label3
Caption = "新密码:"
Height = 375
Left = -74040
TabIndex = 6
Top = 2120
Width = 975
End
Begin VB.Label Label2
Caption = "原密码:"
Height = 375
Left = -74040
TabIndex = 4
Top = 1480
Width = 1095
End
Begin VB.Label Label1
Caption = "当前用户:"
Height = 375
Left = -74040
TabIndex = 1
Top = 840
Width = 1215
End
End
End
Attribute VB_Name = "Form_Consumer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command_User_Exit_Click()
Unload Me
End Sub
Private Sub Command_UserPwd_Change_Click() '密码修改
Dim sqlst As String
If Me.Text_NewUsrPwd.Text = "" Or Me.Text_NewUsrPwd_Confirm.Text = "" Or _
Me.Text_OldUsrPwd.Text = "" Then
MsgBox "不能空白!"
Exit Sub
End If
'原密码核对
If Me.Text_OldUsrPwd.Text <> UserPwd Then
MsgBox "原密码错误!"
Exit Sub
End If
'新密码核对
If Me.Text_NewUsrPwd.Text <> Me.Text_NewUsrPwd_Confirm.Text Then
MsgBox "密码不一致!"
Exit Sub
End If
'修改数据库中的密码
On Error Resume Next
sqlstr = "Update Family set FamilyPwd='" & Me.Text_NewUsrPwd_Confirm.Text & _
"' where FamilyName='" & UserName & "'"
RemoteCnn.Execute sqlstr
MsgBox "修改成功!"
End Sub
Private Sub Command_UserPwdCancel_Click() '取消密码修改
Me.Text_OldUsrPwd.Text = ""
Me.Text_NewUsrPwd.Text = ""
Me.Text_NewUsrPwd_Confirm.Text = ""
End Sub
Private Sub Command3_Click()
Unload Me
Form_UserInsert.Show
End Sub
Private Sub Command5_Click() '删除一个用户
If Me.DataGrid_Usr.Row = -1 Then
MsgBox "没有数据"
Exit Sub
End If
On Error Resume Next
'删除选定的用户
Me.Adodc_user.Recordset.Delete
MsgBox "删除成功"
End Sub
Private Sub Form_Load() '窗体装载
Me.Text_CurUser.Text = UserName
'打开家庭成员表并填充表格
On Error Resume Next
Me.Adodc_user.ConnectionString = "Provider=MSDASQL.1;Persist Security " & _
"Info=False;User ID=" & UID & ";pwd=" & PWD & ";Data Source=" & MyDSN
Adodc_user.RecordSource = "select FamilyID as 编号, FamilyName as 姓名, " & _
"FamilyPwd as 密码, FamilyType as 权限, FamilyBZ as 备注 from Family"
Adodc_user.Refresh
DataGrid_Usr.Columns(0).Width = 500
DataGrid_Usr.Columns(1).Width = 1000
DataGrid_Usr.Columns(2).Width = 1000
'用户的权限控制
If PowerType = 1 Then
Me.SSTab1.TabVisible(1) = False
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -