📄 frmuserman.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form FrmUserMan
BorderStyle = 1 'Fixed Single
Caption = "用户管理"
ClientHeight = 2415
ClientLeft = 45
ClientTop = 330
ClientWidth = 4185
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "FrmUserMan.frx":0000
ScaleHeight = 2415
ScaleWidth = 4185
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Caption = "用户列表"
Height = 2055
Left = 240
TabIndex = 4
Top = 240
Width = 2295
Begin MSDataListLib.DataList DataList1
Height = 1740
Left = 120
TabIndex = 0
Top = 240
Width = 2055
_ExtentX = 3625
_ExtentY = 3069
_Version = 393216
ListField = ""
BoundColumn = ""
End
End
Begin VB.CommandButton Cmd_Add
BackColor = &H80000004&
Caption = "添加用户"
Default = -1 'True
BeginProperty Font
Name = "华文行楷"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 400
Left = 2760
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 1
Top = 480
Width = 1300
End
Begin VB.CommandButton Cmd_Del
BackColor = &H80000004&
Caption = "删除用户"
BeginProperty Font
Name = "华文行楷"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 400
Left = 2760
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 2
Top = 1140
Width = 1300
End
Begin VB.CommandButton Cmd_Back
BackColor = &H80000004&
Cancel = -1 'True
Caption = "返 回"
BeginProperty Font
Name = "华文行楷"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 400
Left = 2760
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 3
Top = 1800
Width = 1300
End
Begin MSAdodcLib.Adodc AdoUserList
Height = 330
Left = 0
Top = 0
Visible = 0 'False
Width = 3135
_ExtentX = 5530
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 1
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 = "AdoUserList"
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
End
Attribute VB_Name = "FrmUserMan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_Add_Click()
With FrmUserEdit
.txtUserName = ""
.txtPass = ""
.txtPass2 = ""
.Modify = False
.Show 1
End With
DataRefresh
End Sub
Private Sub Cmd_Back_Click()
Unload Me
End Sub
Private Sub Cmd_Del_Click()
If DataList1.Text = "" Then
MsgBox "请选择要删除的用户"
Exit Sub
End If
If MyUser.UserName = "Admin" Then
MsgBox "此用户不能删除"
Exit Sub
End If
If MsgBox("是否删除当前用户", vbYesNo, "请确认") = vbYes Then
MyUser.Delete (DataList1.Text)
MsgBox "成功删除"
DataRefresh
End If
End Sub
Private Sub Form_Load()
DataRefresh
End Sub
Private Sub DataRefresh()
AdoUserList.ConnectionString = Conn
AdoUserList.RecordSource = "SELECT * FROM Users"
AdoUserList.Refresh
Set DataList1.RowSource = AdoUserList
DataList1.ListField = "UserName"
DataList1.BoundColumn = "UserName"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -