📄 删除用户.frm
字号:
VERSION 5.00
Begin VB.Form Frm_DelUser
BorderStyle = 1 'Fixed Single
Caption = "删除用户"
ClientHeight = 4275
ClientLeft = 45
ClientTop = 330
ClientWidth = 4815
Icon = "删除用户.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4275
ScaleWidth = 4815
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3120
TabIndex = 3
Top = 3120
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "删除"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3120
TabIndex = 2
Top = 2160
Width = 1215
End
Begin VB.ListBox List1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3420
Left = 1200
TabIndex = 0
Top = 360
Width = 1455
End
Begin VB.Label Label2
Caption = $"删除用户.frx":1042
ForeColor = &H00FF0000&
Height = 975
Left = 3000
TabIndex = 4
Top = 600
Width = 1455
End
Begin VB.Label Label1
Caption = "用户名:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 255
Left = 360
TabIndex = 1
Top = 240
Width = 855
End
End
Attribute VB_Name = "Frm_DelUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If List1.Text = "" Then
MsgBox "请输入用户名!", vbOKOnly, "警告"
Exit Sub
End If
vbyorn = MsgBox("确定要删除吗?", vbOKCancel, "警告")
If vbyorn = vbOK Then
Frm_LiulanUser.Adodc1.Recordset.Delete
Frm_LiulanUser.Adodc1.Recordset.MoveNext
'MsgBox "删除成功!", vbOKOnly, "恭喜"
List1.RemoveItem List1.ListIndex
End If
Frm_LiulanUser.Adodc1.Refresh
'Frm_LiulanUser.DataGrid1.Refresh
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim a As String
Frm_LiulanUser.Adodc1.RecordSource = "select * from 用户资料"
Frm_LiulanUser.Adodc1.Refresh
Do While Not Frm_LiulanUser.Adodc1.Recordset.EOF
a = Frm_LiulanUser.Adodc1.Recordset.Fields(0)
List1.AddItem a
Frm_LiulanUser.Adodc1.Recordset.MoveNext
Loop
List1.Text = ""
End Sub
Private Sub List1_Click()
Frm_LiulanUser.Adodc1.RecordSource = "select * from 用户资料 where 用户名 = '" & Trim(List1.Text) & "'"
Frm_LiulanUser.Adodc1.Refresh
Frm_LiulanUser.DataGrid1.Refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -