📄 form9.frm
字号:
VERSION 5.00
Begin VB.Form Form9
BackColor = &H00FF0000&
Caption = "管理员设置"
ClientHeight = 3615
ClientLeft = 60
ClientTop = 420
ClientWidth = 5655
LinkTopic = "Form9"
ScaleHeight = 3615
ScaleWidth = 5655
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "取消"
Height = 495
Left = 4080
TabIndex = 6
Top = 2880
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "删除"
Height = 495
Left = 2040
TabIndex = 5
Top = 2880
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 495
Left = 120
TabIndex = 4
Top = 2880
Width = 1215
End
Begin VB.TextBox Text2
Height = 495
Left = 960
TabIndex = 3
Top = 1560
Width = 4335
End
Begin VB.TextBox Text1
Height = 495
Left = 960
TabIndex = 2
Top = 480
Width = 4335
End
Begin VB.Label Label2
BackColor = &H00FF0000&
Caption = "密码:"
Height = 495
Left = 120
TabIndex = 1
Top = 1560
Width = 1215
End
Begin VB.Label Label1
BackColor = &H00FF0000&
Caption = "用户名:"
Height = 495
Left = 120
TabIndex = 0
Top = 600
Width = 1215
End
End
Attribute VB_Name = "Form9"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim rs As ADODB.Command
Dim str As String
Call open_db
str = "insert into 用户管理(用户名,用户密码)"
str = str & "Values('" & Text1 & "','" & Text2 & "')"
Set rs = New ADODB.Command
Set rs.ActiveConnection = adocon
rs.CommandText = str
rs.Execute
Set rs = Nothing
adocon.Close
Set adocon = Nothing
Call close_db
MsgBox "添加成功!", , vbOKOnly
End Sub
Private Sub Command2_Click()
Dim rs As ADODB.Command
Dim str As String
Set rs = New ADODB.Command
Call open_db
str = "delete from 用户管理 where 用户名= '" & Text1 & "'"
Set rs.ActiveConnection = adocon
rs.CommandText = str
rs.Execute
Set rs = Nothing
adocon.Close
Set adocon = Nothing
Call close_db
MsgBox "删除成功!", , vbOKOnly
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -