📄 omitusername.frm
字号:
VERSION 5.00
Begin VB.Form omituser
Caption = "删除用户"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdcancel
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2640
TabIndex = 3
Top = 1800
Width = 855
End
Begin VB.CommandButton cmdok
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1080
TabIndex = 2
Top = 1800
Width = 855
End
Begin VB.TextBox txtusername
Height = 495
Left = 1800
TabIndex = 1
Top = 840
Width = 1695
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "输入要删除的用户名"
BeginProperty Font
Name = "宋体"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 0
Top = 840
Width = 1215
End
End
Attribute VB_Name = "omituser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdcancel_Click()
Unload Me
End Sub
Private Sub cmdok_Click()
Dim txtsql, msgtext As String
Dim mrc As ADODB.Recordset
If username = Trim(txtusername.Text) Then
MsgBox "你现在正在使用这个帐户,不能删除!", vbOKOnly + vbExclamation, "警告"
Exit Sub
Else
txtsql = "select * from operator where username='" & Trim(txtusername.Text) & "'"
Set mrc = ExecuteSQL(txtsql, msgtext)
If mrc.EOF = True Then
MsgBox "没有这个用户,请重新输入!", vbOKOnly + vbExclamation, "警告"
txtusername = ""
txtusername.SetFocus
mrc.Close
Else
If MsgBox("真的要删除这条文件记录吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then
txtsql = "delete from operator where username='" & Trim(txtusername.Text) & "'"
Set mrc = ExecuteSQL(txtsql, msgtext)
MsgBox "用户成功删除!", vbOKOnly, "信息提示"
Unload Me
Else
txtusername.SetFocus
End If
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -