📄 frmaddmanager.frm
字号:
VERSION 5.00
Begin VB.Form FrmAddManager
BorderStyle = 1 'Fixed Single
Caption = "增加管理员界面"
ClientHeight = 5145
ClientLeft = 45
ClientTop = 435
ClientWidth = 5385
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5145
ScaleWidth = 5385
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdExit
Caption = "返回"
Height = 375
Left = 3000
TabIndex = 12
Top = 4320
Width = 975
End
Begin VB.CommandButton cmdSubmit
Caption = "提交"
Height = 375
Left = 1200
TabIndex = 11
Top = 4320
Width = 975
End
Begin VB.Frame Frame1
Caption = "管理员信息"
Height = 3855
Left = 360
TabIndex = 0
Top = 240
Width = 4575
Begin VB.TextBox txtSeq
Height = 375
Left = 1800
TabIndex = 5
Top = 360
Width = 2175
End
Begin VB.TextBox txtId
Height = 375
Left = 1800
TabIndex = 4
Top = 960
Width = 2175
End
Begin VB.TextBox txtPwd
Height = 375
Left = 1800
TabIndex = 3
Top = 1680
Width = 2175
End
Begin VB.TextBox txtTime
Height = 375
Left = 1800
TabIndex = 2
Top = 2400
Width = 2175
End
Begin VB.TextBox txtPhone
Height = 375
Left = 1800
TabIndex = 1
Top = 3120
Width = 2175
End
Begin VB.Label Label1
Caption = "编号:"
Height = 375
Left = 840
TabIndex = 10
Top = 360
Width = 735
End
Begin VB.Label Label2
Caption = "登录密码:"
Height = 375
Left = 480
TabIndex = 9
Top = 1680
Width = 1095
End
Begin VB.Label Label3
Caption = "登录Id:"
Height = 375
Left = 720
TabIndex = 8
Top = 960
Width = 855
End
Begin VB.Label Label4
Caption = "工作时间(AM/PM):"
Height = 375
Left = 480
TabIndex = 7
Top = 2400
Width = 1095
End
Begin VB.Label Label5
Caption = "联系电话:"
Height = 375
Left = 480
TabIndex = 6
Top = 3240
Width = 1095
End
End
End
Attribute VB_Name = "FrmAddManager"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdExit_Click()
Me.Hide
End Sub
Private Sub cmdSubmit_Click()
'检验数据的有效性
If Trim(txtId) = "" Then
MsgBox "请输入登录Id"
Exit Sub
End If
If Trim(txtPwd) = "" Then
MsgBox "请输入登录密码"
Exit Sub
End If
Dim myDbOper As New DbOperation
Dim rst As ADODB.Recordset
Dim sql As String
'建立连接
myDbOper.DB_Connect
'定义查询语句
sql = "SELECT * FROM Librarian WHERE seq='" + Trim(txtSeq) + "'"
Set rst = myDbOper.querySQL(sql)
If rst.EOF = True Then
With rst
.AddNew
!seq = Me.txtSeq
!id = Me.txtId
!Password = Me.txtPwd
!onJobTime = Me.txtTime
!telephone = Me.txtPhone
.Update
End With
MsgBox "信息添加成功."
Else
MsgBox "该编号已经存在,请重新输入."
End If
rst.Close
'关闭连接
myDbOper.DB_DisConnect
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -