📄 frmscuser.frm
字号:
VERSION 5.00
Object = "{1666F204-B71B-4E6D-AA21-DCE71B94F422}#7.0#0"; "SmartXpButton.ocx"
Begin VB.Form FrmScuser
BackColor = &H8000000B&
BorderStyle = 0 'None
ClientHeight = 2865
ClientLeft = 0
ClientTop = 0
ClientWidth = 3660
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 191
ScaleMode = 3 'Pixel
ScaleWidth = 244
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 1200
TabIndex = 1
Top = 1320
Width = 2000
End
Begin SmartXpButton.SmartNetXpButton ComFirst
Height = 420
Index = 4
Left = 360
TabIndex = 3
ToolTipText = "至第一条记录"
Top = 600
Width = 450
_ExtentX = 794
_ExtentY = 741
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Picture = "FrmScuser.frx":0000
ShowPictureFixSize= -1 'True
PictureFixWidth = 24
PictureFixHeight= 26
End
Begin SmartXpButton.SmartNetXpButton CmdPrevious
Height = 420
Index = 5
Left = 1200
TabIndex = 4
ToolTipText = "上一条记录"
Top = 600
Width = 450
_ExtentX = 794
_ExtentY = 741
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Picture = "FrmScuser.frx":0390
ShowPictureFixSize= -1 'True
PictureFixWidth = 24
PictureFixHeight= 26
End
Begin SmartXpButton.SmartNetXpButton Cmdnext
Height = 420
Index = 6
Left = 2040
TabIndex = 5
ToolTipText = "下一条记录"
Top = 600
Width = 450
_ExtentX = 794
_ExtentY = 741
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Picture = "FrmScuser.frx":0715
ShowPictureFixSize= -1 'True
PictureFixWidth = 24
PictureFixHeight= 26
End
Begin SmartXpButton.SmartNetXpButton CmdLast
Height = 420
Index = 7
Left = 2880
TabIndex = 6
ToolTipText = "至最后记录"
Top = 600
Width = 450
_ExtentX = 794
_ExtentY = 741
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Picture = "FrmScuser.frx":0A9A
ShowPictureFixSize= -1 'True
PictureFixWidth = 24
PictureFixHeight= 26
End
Begin SmartXpButton.SmartNetXpButton Comok
Height = 375
Left = 480
TabIndex = 7
Top = 2040
Width = 975
_ExtentX = 1720
_ExtentY = 661
BackColor = -2147483637
CaptionAreaLayout= 1
Caption = "删除"
CaptionBackColor= 12648447
ShowCaption = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ShowPictureFixSize= -1 'True
PictureFixWidth = 0
PictureFixHeight= 0
HotKeyDynamicEffect= 0 'False
End
Begin SmartXpButton.SmartNetXpButton Comcancel
Height = 375
Left = 2160
TabIndex = 8
Top = 2040
Width = 975
_ExtentX = 1720
_ExtentY = 661
BackColor = -2147483637
CaptionAreaLayout= 1
Caption = "取消"
CaptionBackColor= 12648447
ShowCaption = -1 'True
ShowPushColor = 0 'False
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ShowPictureFixSize= -1 'True
PictureFixWidth = 0
PictureFixHeight= 0
End
Begin VB.Label Label1
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 = &H00000000&
Height = 255
Index = 1
Left = 360
TabIndex = 2
Top = 1335
Width = 1095
End
Begin VB.Label lblTitle
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "删除用户"
BeginProperty Font
Name = "Arial"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 240
Left = 0
TabIndex = 0
Top = 0
Width = 1020
End
Begin VB.Image imgTitleMinimize
Height = 195
Left = 1440
Picture = "FrmScuser.frx":0E43
Top = 960
Width = 195
End
Begin VB.Image imgTitleClose
Height = 195
Left = 1440
Picture = "FrmScuser.frx":108D
Top = 600
Width = 195
End
Begin VB.Image imgTitleHelp
Height = 195
Left = 1440
Picture = "FrmScuser.frx":12D7
Top = 240
Width = 195
End
Begin VB.Image imgTitleLeft
Height = 450
Left = 0
Picture = "FrmScuser.frx":1521
Top = 240
Width = 285
End
Begin VB.Image imgTitleRight
Height = 450
Left = 360
Picture = "FrmScuser.frx":1C6B
Top = 240
Width = 285
End
Begin VB.Image imgWindowBottomLeft
Height = 450
Left = 720
Picture = "FrmScuser.frx":23B5
Top = 240
Width = 285
End
Begin VB.Image imgWindowBottomRight
Height = 450
Left = 1080
Picture = "FrmScuser.frx":2AFF
Top = 240
Width = 285
End
Begin VB.Image imgTitleMain
Height = 450
Left = 0
Picture = "FrmScuser.frx":3249
Stretch = -1 'True
Top = 720
Width = 285
End
Begin VB.Image imgWindowBottom
Height = 450
Left = 360
Picture = "FrmScuser.frx":3993
Stretch = -1 'True
Top = 720
Width = 285
End
Begin VB.Image imgWindowLeft
Height = 450
Left = 720
Picture = "FrmScuser.frx":40DD
Stretch = -1 'True
Top = 720
Width = 285
End
Begin VB.Image imgWindowRight
Height = 450
Left = 1080
Picture = "FrmScuser.frx":4827
Stretch = -1 'True
Top = 720
Width = 285
End
End
Attribute VB_Name = "FrmScuser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mrc As ADODB.Recordset
Private Sub CmdLast_Click(Index As Integer)
mrc.MoveLast
Call viewData
End Sub
Private Sub Cmdnext_Click(Index As Integer)
mrc.MoveNext
If mrc.EOF Then
mrc.MoveFirst
End If
Call viewData
End Sub
Private Sub CmdPrevious_Click(Index As Integer)
mrc.MovePrevious
If mrc.BOF Then
mrc.MoveLast
End If
Call viewData
End Sub
Private Sub ComFirst_Click(Index As Integer)
mrc.MoveFirst
Call viewData
End Sub
'初始化窗口,使用户名为空
Private Sub Form_Load()
Dim txtSQL As String
Dim MsgText As String
Dim mrcc As ADODB.Recordset
txtSQL = "select user_id from user_Infor"
Set mrcc = ExecuteSQL(txtSQL, MsgText)
If Not mrcc.EOF Then
mrcc.MoveFirst
Do While Not mrcc.EOF
Combo1.AddItem Trim(mrcc.Fields(0))
mrcc.MoveNext
Loop
End If
mrcc.Close
Call reflashform
MakeWindow Me
AlwaysOnTop Me, True
End Sub
Private Sub imgTitleClose_Click()
Unload Me
End Sub
Public Sub reflashform()
Dim txtSQL As String
Dim MsgText As String
txtSQL = "select user_id from user_Infor"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If Not mrc.EOF Then
mrc.MoveFirst
End If
Call viewData
End Sub
Public Sub viewData()
Combo1.Text = Trim(mrc.Fields(0))
End Sub
Private Sub imgTitleHelp_Click()
MsgBox "You can insert code here for loading a help file."
End Sub
Private Sub imgTitleLeft_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
DoDrag Me
End Sub
Private Sub imgTitleMain_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
DoDrag Me
End Sub
Private Sub imgTitleMinimize_Click()
Me.WindowState = 1
End Sub
Private Sub imgTitleRight_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
DoDrag Me
End Sub
Private Sub lblTitle_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
DoDrag Me
End Sub
'定义取消按钮
Private Sub Comcancel_Click()
Unload Me
End Sub
'定义确定按钮
Private Sub Comok_Click()
Dim txtSQL As String
Dim MsgText As String
txtSQL = "select * from user_infor where user_id = '" & Trim(Combo1.Text) & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
'先按编号查询到财产信息,再删除
If mrc.BOF Then
MsgBox "没有此用户!", vbOKOnly + vbExclamation, "无法删除"
Else
'提示是否删除
str2$ = MsgBox("是否删除当前记录?", vbOKCancel, "删除当前记录")
If str2$ = vbOK Then
If Trim(mrc.Fields(0)) <> "Administrator" Then
mrc.Delete
MsgBox "删除成功!", vbOKOnly + vbExclamation, "警告"
Else
MsgBox "不能删除管理员!", vbOKOnly + vbExclamation, "警告"
End If
End If
End If
Call reflashform
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -