📄 frmper.frm
字号:
VERSION 5.00
Begin VB.Form frmPerson
Caption = "人员一览表维护"
ClientHeight = 1830
ClientLeft = 60
ClientTop = 390
ClientWidth = 4680
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form3"
MaxButton = 0 'False
MinButton = 0 'False
Moveable = 0 'False
ScaleHeight = 1830
ScaleWidth = 4680
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "关 闭(&C)"
Height = 375
Left = 2760
TabIndex = 5
Top = 1320
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "录 入(&R)"
Height = 375
Left = 240
TabIndex = 4
Top = 1320
Width = 1575
End
Begin VB.ComboBox Combo1
ForeColor = &H8000000D&
Height = 420
ItemData = "frmper.frx":0000
Left = 1440
List = "frmper.frx":000D
TabIndex = 3
Top = 720
Width = 2895
End
Begin VB.TextBox Text1
ForeColor = &H8000000D&
Height = 420
Left = 1440
MaxLength = 20
TabIndex = 2
Top = 120
Width = 2895
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "人员类别"
Height = 300
Left = 240
TabIndex = 1
Top = 840
Width = 960
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "人员名称"
Height = 300
Left = 240
TabIndex = 0
Top = 240
Width = 960
End
End
Attribute VB_Name = "frmPerson"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Combo1.Text = "" Then
rc = MsgBox("请选择人员类别", vbOKOnly + vbExclamation, "输入数据不完整")
Combo1.SetFocus
Exit Sub
End If
If Text1.Text = "" Then
rc = MsgBox("请输入人员名称!", vbOKOnly + vbExclamation, "输入数据不完整")
Text1.SetFocus
Exit Sub
End If
rc = SQLAllocStmt(hdbc, hstmt)
If rc = SQL_ERROR Then
MsgBox "数据库连接失败。", vbCritical + vbOKOnly, "SQL出错"
Unload Form1
End
End If
SQLstmt = "INSERT INTO person VALUES ('" & Text1.Text & "','" & Combo1.Text & "')"
rc = SQLExecDirect(hstmt, SQLstmt, SQL_NTS)
If rc <> SQL_ERROR Then
rc = MsgBox("以上数据已输入数据库中!", vbOKOnly + vbExclamation, "录入成功")
End If
rc = SQLFreeStmt(hstmt, SQL_DROP)
Text1.Text = ""
Text1.SetFocus
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
Combo1.Clear
Form1.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -