📄 form5.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form5
BackColor = &H00FFC0FF&
BorderStyle = 1 'Fixed Single
Caption = "删除用户"
ClientHeight = 3435
ClientLeft = 45
ClientTop = 330
ClientWidth = 6435
LinkTopic = "Form5"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3435
ScaleWidth = 6435
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 645
Top = 4680
Width = 3225
_ExtentX = 5689
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=test;Data Source=(local)"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=test;Data Source=(local)"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command2
BackColor = &H00C0C0FF&
Cancel = -1 'True
Caption = "返回(&E)"
Height = 360
Left = 2460
Style = 1 'Graphical
TabIndex = 3
Top = 1755
Width = 1080
End
Begin VB.CommandButton Command1
BackColor = &H00C0C0FF&
Caption = "确定(&A)"
Default = -1 'True
Height = 360
Left = 495
Style = 1 'Graphical
TabIndex = 2
Top = 1740
Width = 1080
End
Begin VB.Frame Frame1
BackColor = &H00FFC0FF&
Caption = "请选择您要删除的用户帐号"
ForeColor = &H00FF0000&
Height = 1050
Left = 450
TabIndex = 0
Top = 510
Width = 3225
Begin VB.ComboBox Combo1
BackColor = &H00C0C0FF&
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
ItemData = "Form5.frx":0000
Left = 555
List = "Form5.frx":0002
Style = 2 'Dropdown List
TabIndex = 1
Top = 420
Width = 2190
End
End
Begin VB.Label Label1
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 225
Left = 300
TabIndex = 4
Top = 60
Width = 3750
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim a
Private Sub Command1_Click()
If Combo1.Text = "wtl" Then
MsgBox "该用户为超级用户,您不能删除!", 48, "提示"
Exit Sub
End If
a = MsgBox("您确认要删除该用户吗?", 17, "用户管理系统")
If a = vbOK Then
Adodc1.RecordSource = "select * from Table1_user where 帐号='" + Combo1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.Delete
Unload Form5
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
Adodc1.RecordSource = "select * from Table1_user "
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
Do While Adodc1.Recordset.EOF = False
Combo1.AddItem (Adodc1.Recordset.Fields("帐号"))
Adodc1.Recordset.MoveNext
Loop
End If
Combo1.ListIndex = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -