📄 添加管理员表.frm
字号:
VERSION 5.00
Begin VB.Form Form11
Caption = "Form11"
ClientHeight = 3300
ClientLeft = 60
ClientTop = 405
ClientWidth = 4755
LinkTopic = "Form11"
ScaleHeight = 3300
ScaleWidth = 4755
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "返 回"
Height = 495
Left = 2640
TabIndex = 2
Top = 2280
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "添 加"
Height = 495
Left = 480
TabIndex = 1
Top = 2280
Width = 1215
End
Begin VB.Frame Frame1
Caption = "请输入"
Height = 1935
Left = 0
TabIndex = 0
Top = 0
Width = 4815
Begin VB.TextBox Text3
Height = 495
Left = 3360
TabIndex = 10
Top = 240
Width = 1095
End
Begin VB.ComboBox Combo1
Height = 315
ItemData = "添加管理员表.frx":0000
Left = 3360
List = "添加管理员表.frx":000A
TabIndex = 8
Text = "男"
Top = 1320
Width = 1095
End
Begin VB.TextBox Text2
Height = 495
Left = 1080
TabIndex = 6
Top = 1200
Width = 975
End
Begin VB.TextBox Text1
Height = 495
Left = 1080
TabIndex = 4
Top = 240
Width = 975
End
Begin VB.Label Label4
Caption = "年龄:"
Height = 375
Left = 2640
TabIndex = 9
Top = 360
Width = 735
End
Begin VB.Label Label3
Caption = "性 别:"
Height = 495
Left = 2640
TabIndex = 7
Top = 1320
Width = 735
End
Begin VB.Label Label2
Caption = "姓 名:"
Height = 375
Left = 240
TabIndex = 5
Top = 1320
Width = 855
End
Begin VB.Label Label1
Caption = "管理员号:"
Height = 495
Left = 120
TabIndex = 3
Top = 360
Width = 1095
End
End
End
Attribute VB_Name = "Form11"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim strInsert As String
strInsert = "insert into 管理员表 values('" & Text1.Text & "','" & Text2.Text & "','" & Combo1.Text & "', '" & Text3.Text & "')"
mycon.BeginTrans
mycon.Execute (strInsert)
mycon.CommitTrans
MsgBox "添加成功", vbInformation, "提示"
Text1.Text = "": Text2.Text = "": Text3.Text = ""
Text1.SetFocus
Exit Sub
errhandle:
MsgBox "添加失败", vbInformation, "提示"
mycon.RollbackTrans
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -