📄 form5.frm
字号:
VERSION 5.00
Begin VB.Form login4
Caption = "删除用户"
ClientHeight = 2895
ClientLeft = 60
ClientTop = 345
ClientWidth = 4365
LinkTopic = "Form5"
ScaleHeight = 2895
ScaleWidth = 4365
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 2040
TabIndex = 3
Top = 2160
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "删除"
Height = 495
Left = 720
TabIndex = 2
Top = 2160
Width = 1215
End
Begin VB.TextBox Text1
Height = 615
Left = 840
TabIndex = 0
Top = 960
Width = 2655
End
Begin VB.Label Label2
Caption = "请 输 入 要 删 除 的 用 户 名 "
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF80FF&
Height = 375
Left = 120
TabIndex = 4
Top = 240
Width = 4575
End
Begin VB.Label Label1
Caption = "用户名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 120
TabIndex = 1
Top = 1200
Width = 735
End
End
Attribute VB_Name = "login4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim rs As ADODB.Recordset
Dim sql As String
If Text1.Text = "" Then
MsgBox "请输入用户名", vbOKOnly + vbExclamation, "提示!"
Else
sql = "select * from username where userid='" & Text1.Text & "'"
Set rs = TransactSQL(sql)
If rs.EOF = False Then
sql = "delete * from username where userid='" & Text1.Text & "'"
Set rs = TransactSQL(sql)
MsgBox "删除用户成功", vbOKOnly + vbExclamation, "提示!"
Text1.Text = ""
Else
MsgBox "没有此用户", vbOKOnly + vbExclamation, "提示!"
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
Exit Sub
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -