📄 addstu.frm
字号:
VERSION 5.00
Begin VB.Form addreader
BorderStyle = 1 'Fixed Single
Caption = "添加读者"
ClientHeight = 3345
ClientLeft = 45
ClientTop = 435
ClientWidth = 5505
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3345
ScaleWidth = 5505
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Height = 3135
Index = 1
Left = 105
TabIndex = 0
Top = 105
Width = 5295
Begin VB.CommandButton Command2
Caption = "取消(&C)"
Height = 375
Left = 3885
TabIndex = 13
Top = 2520
Width = 975
End
Begin VB.CommandButton Command1
Caption = "保存(&E)"
Height = 375
Left = 2415
TabIndex = 12
Top = 2520
Width = 975
End
Begin VB.TextBox Text3
Height = 270
Left = 1050
TabIndex = 11
Text = "Text3"
Top = 1050
Width = 1455
End
Begin VB.TextBox Text1
Height = 270
Left = 1050
TabIndex = 10
Text = "Text1"
Top = 435
Width = 1455
End
Begin VB.TextBox Text5
Height = 270
Left = 1575
TabIndex = 8
Text = "Text5"
Top = 1635
Width = 2925
End
Begin VB.TextBox Text4
Height = 270
Left = 3465
TabIndex = 7
Text = "Text4"
Top = 1050
Width = 1455
End
Begin VB.TextBox Text2
Height = 270
Left = 3465
TabIndex = 6
Text = "Text2"
Top = 420
Width = 1455
End
Begin VB.Frame Frame2
Height = 135
Index = 1
Left = 1080
TabIndex = 1
Top = 2160
Width = 3855
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "借书证号"
Height = 180
Index = 5
Left = 240
TabIndex = 9
Top = 480
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "Email:"
Height = 180
Index = 1
Left = 735
TabIndex = 5
Top = 1680
Width = 630
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "姓 名"
Height = 180
Index = 6
Left = 2640
TabIndex = 4
Top = 480
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "年 龄"
Height = 180
Index = 7
Left = 240
TabIndex = 3
Top = 1080
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "城 市"
Height = 180
Index = 8
Left = 2640
TabIndex = 2
Top = 1080
Width = 720
End
Begin VB.Image Image1
Height = 480
Index = 1
Left = 240
Picture = "addstu.frx":0000
Top = 2280
Width = 480
End
End
End
Attribute VB_Name = "addreader"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo error
If MsgBox("确实要添加吗?", vbYesNo + vbQuestion, "提示") = vbYes Then
Call upD1
rst.Update
MsgBox "添加成功"
End If
Exit Sub
error:
MsgBox "读者编号重复或者输入错误!", vbOKOnly + vbCritical, "提示"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
On Error GoTo fmerr
If QueryData("select * from reader") = True Then
Else
MsgBox "查询失败!"
End If
Exit Sub
fmerr:
If rst.BOF = True And rst.EOF = True Then
MsgBox "没有任何记录!"
End If
End Sub
Private Sub upD1()
rst.AddNew
rst.Fields(0).Value = Text1.Text
rst.Fields(1).Value = Text2.Text
rst.Fields(2).Value = Text3.Text
rst.Fields(3).Value = Text4.Text
rst.Fields(4).Value = Text5.Text
rst.Update
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -