📄 deluser.frm
字号:
VERSION 5.00
Begin VB.Form deluser
Caption = "删除用户"
ClientHeight = 5085
ClientLeft = 135
ClientTop = 420
ClientWidth = 8145
LinkTopic = "Form1"
ScaleHeight = 5085
ScaleWidth = 8145
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "删除系统用户"
ForeColor = &H00764E10&
Height = 2625
Left = 2040
TabIndex = 0
Top = 1080
Width = 4905
Begin VB.CommandButton command1
BackColor = &H00E2D1D3&
Caption = "删除"
Default = -1 'True
Height = 375
Left = 1800
MaskColor = &H00987758&
Style = 1 'Graphical
TabIndex = 4
Top = 1950
UseMaskColor = -1 'True
Width = 1335
End
Begin VB.CommandButton Command2
BackColor = &H00E2D1D3&
Caption = "取消"
Height = 375
Left = 3165
MaskColor = &H00987758&
Style = 1 'Graphical
TabIndex = 3
Top = 1950
UseMaskColor = -1 'True
Width = 1335
End
Begin VB.TextBox text1
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
ForeColor = &H00987758&
Height = 315
Left = 1785
MaxLength = 15
TabIndex = 2
ToolTipText = "Enter LogIn ID Here"
Top = 675
Width = 2745
End
Begin VB.TextBox text2
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
ForeColor = &H00987758&
Height = 315
IMEMode = 3 'DISABLE
Left = 1785
MaxLength = 10
PasswordChar = "*"
TabIndex = 1
ToolTipText = "Enter Password Here"
Top = 1320
Width = 2745
End
Begin VB.Label Label4
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "登录账号:"
ForeColor = &H00987758&
Height = 285
Left = 345
TabIndex = 6
Top = 705
Width = 1425
End
Begin VB.Label Label7
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "管理员密码:"
ForeColor = &H00987758&
Height = 285
Left = 0
TabIndex = 5
Top = 1350
Width = 1755
End
End
End
Attribute VB_Name = "deluser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub command1_Click()
If text1.Text = "" Then
MsgBox "Enter A Login ID:", vbCritical
text1.SetFocus
Exit Sub
End If
If text2.Text = "" Then
MsgBox "Enter An Administrator Password:", vbCritical
text2.SetFocus
Exit Sub
End If
Call openconn
sqlstr = "select * from users where loginid = '" & text1.Text & "' and pass = '" & text2.Text & "'"
Call rs(sqlstr)
If (adoRS.EOF) Then
MsgBox "Wrong Password! Try Again With Correct Password", vbCritical
text1.Text = ""
text1.SetFocus
Call closeconn
Exit Sub
End If
Call closeconn
Call openconn
sqlstr = "select * from users where loginid = '" & text1.Text & "'"
Call rs(sqlstr)
If (adoRS.EOF) Then
MsgBox "Login ID (" & text1.Text & ") Does Not Exist! Enter Valid Login ID", vbCritical
text1.Text = ""
text1.SetFocus
Call closeconn
Exit Sub
End If
Call closeconn
Call openconn
sqlstr = "delete from users where loginid = '" & text1.Text & "'"
Call rs(sqlstr)
Call closeconn
MsgBox "User Deleted Successfully!", vbInformation
Unload Me
End Sub
Private Sub command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -