📄 frmdeleteuser.frm
字号:
VERSION 5.00
Begin VB.Form frmDeleteUser
BackColor = &H80000007&
Caption = "Form1"
ClientHeight = 2085
ClientLeft = 60
ClientTop = 345
ClientWidth = 6465
LinkTopic = "Form1"
ScaleHeight = 2085
ScaleWidth = 6465
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox txt
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
IMEMode = 3 'DISABLE
Left = 1800
TabIndex = 3
Top = 480
Width = 2415
End
Begin VB.CommandButton cmdFinally
Caption = "完 成"
Default = -1 'True
Height = 345
Left = 2400
TabIndex = 2
Top = 1440
Width = 975
End
Begin VB.CommandButton cmdFind
Caption = "查 看"
Height = 345
Left = 1080
TabIndex = 1
Top = 1440
Width = 975
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取 消"
Height = 345
Left = 3720
TabIndex = 0
Top = 1440
Width = 975
End
Begin VB.Line line
BorderColor = &H00FFFFFF&
BorderWidth = 2
X1 = -720
X2 = 7080
Y1 = 360
Y2 = 360
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "删除用户"
BeginProperty Font
Name = "华文新魏"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 315
Index = 2
Left = 2400
TabIndex = 6
Top = 0
Width = 1260
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "(用户名不能长于12位)"
ForeColor = &H00FFFFFF&
Height = 180
Index = 1
Left = 4440
TabIndex = 5
Top = 600
Width = 1800
End
Begin VB.Label lbl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请入新用户的帐号:"
ForeColor = &H00FFFFFF&
Height = 180
Index = 4
Left = 120
TabIndex = 4
Top = 600
Width = 1620
End
End
Attribute VB_Name = "frmDeleteUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rst As Recordset
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdFinally_Click()
Set rst = New Recordset
Dim canDelete As Boolean
canDelete = False
Call LinkDB(landWay, SName, "weboy", SUName, SUPw)
con.Open
rst.Open "select name from users", con, adOpenDynamic, adLockOptimistic
Do While Not rst.EOF
If rst!name = txt.Text Then
canDelete = True
End If
rst.MoveNext
Loop
rst.Close
If canDelete = False Then
MsgBox "帐户未找到,请确定您所输入的正确!"
con.Close
Exit Sub
Else
con.Execute "delete from users where name='" & txt.Text & "'"
MsgBox "帐号删除成功!"
con.Close
Unload Me
End If
End Sub
Private Sub cmdFind_Click()
Set rst = New Recordset
Call LinkDB(landWay, SName, "weboy", SUName, SUPw)
con.Open
rst.Open "select * from users", con, adOpenDynamic, adLockOptimistic
rst.MoveFirst
Do While Not rst.EOF
frmAllUser.lst.AddItem (rst!name)
rst.MoveNext
Loop
rst.Close
con.Close
frmAllUser.Show
End Sub
Private Sub Form_Load()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -