📄 frmpsgl.frm
字号:
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=tsgl"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=tsgl"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from dzjstb"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Frame Frame3
Caption = "书籍信息"
Height = 1815
Left = 3120
TabIndex = 17
Top = 1920
Width = 3975
Begin VB.Label Label13
BorderStyle = 1 'Fixed Single
Height = 300
Left = 1440
TabIndex = 25
Top = 1250
Width = 2295
End
Begin VB.Label Label12
Caption = "借出日期:"
Height = 255
Left = 260
TabIndex = 24
Top = 1320
Width = 975
End
Begin VB.Label Label17
BorderStyle = 1 'Fixed Single
Height = 300
Left = 1440
TabIndex = 21
Top = 780
Width = 2295
End
Begin VB.Label Label15
BorderStyle = 1 'Fixed Single
Height = 300
Left = 1440
TabIndex = 20
Top = 320
Width = 2295
End
Begin VB.Label Label11
Caption = "类别代码:"
Height = 255
Left = 260
TabIndex = 19
Top = 880
Width = 975
End
Begin VB.Label Label9
Caption = "书籍名称:"
Height = 255
Left = 260
TabIndex = 18
Top = 435
Width = 975
End
End
Begin VB.Frame Frame2
Caption = "读者信息"
Height = 1695
Left = 3120
TabIndex = 11
Top = 120
Width = 3975
Begin VB.Label Label8
BorderStyle = 1 'Fixed Single
Height = 300
Left = 1440
TabIndex = 26
Top = 1250
Width = 2295
End
Begin VB.Label Label7
BorderStyle = 1 'Fixed Single
Height = 300
Left = 1440
TabIndex = 16
Top = 770
Width = 2295
End
Begin VB.Label Label6
BorderStyle = 1 'Fixed Single
Height = 300
Left = 1440
TabIndex = 15
Top = 290
Width = 2295
End
Begin VB.Label Label5
Caption = "借书数量:"
Height = 255
Left = 255
TabIndex = 14
Top = 1320
Width = 975
End
Begin VB.Label Label4
Caption = "书籍价格:"
Height = 255
Left = 255
TabIndex = 13
Top = 840
Width = 975
End
Begin VB.Label Label3
Caption = "读者姓名:"
Height = 255
Left = 260
TabIndex = 12
Top = 360
Width = 975
End
End
Begin VB.Frame Frame1
Caption = "输入"
Height = 3615
Left = 120
TabIndex = 2
Top = 120
Width = 2895
Begin VB.TextBox Text3
Height = 300
Left = 1200
TabIndex = 4
Top = 1320
Width = 1455
End
Begin VB.CommandButton Command3
Caption = "丢失"
Height = 375
Left = 210
TabIndex = 6
Top = 3120
Width = 855
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 300
Left = 1200
TabIndex = 3
Top = 960
Width = 1455
_ExtentX = 2566
_ExtentY = 529
_Version = 393216
Format = 49545217
CurrentDate = 38311
End
Begin VB.CommandButton Command2
Caption = "返回"
Height = 375
Left = 1920
TabIndex = 8
Top = 3120
Width = 855
End
Begin VB.CommandButton Command1
Caption = "确定"
Enabled = 0 'False
Height = 375
Left = 1070
TabIndex = 7
Top = 3120
Width = 855
End
Begin VB.TextBox Text2
Height = 300
Left = 1200
TabIndex = 1
Top = 600
Width = 1455
End
Begin VB.TextBox Text1
Height = 300
Left = 1200
TabIndex = 0
Top = 240
Width = 1455
End
Begin VB.Label Label16
Caption = "丢失数量:"
Height = 255
Left = 120
TabIndex = 23
Top = 1440
Width = 975
End
Begin VB.Label Label10
Caption = "丢失日期:"
Height = 255
Left = 120
TabIndex = 22
Top = 1080
Width = 975
End
Begin VB.Label Label14
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "隶书"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 1215
Left = 120
TabIndex = 5
Top = 1800
Width = 2655
End
Begin VB.Label Label2
Caption = "条 码 号:"
Height = 255
Left = 120
TabIndex = 10
Top = 720
Width = 975
End
Begin VB.Label Label1
Caption = "读者编号:"
Height = 255
Left = 120
TabIndex = 9
Top = 360
Width = 975
End
End
End
Attribute VB_Name = "frmpsgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As ADODB.Recordset
Dim i, c As Integer
Private Sub Combo2_Click()
If Combo2.Text <> " Like" Then
i = 0
ElseIf Combo2.Text = " Like" Then
i = 1
End If
End Sub
Private Sub Command1_Click()
c = MsgBox("该图书确认丢失了吗?", 33, "提示信息")
If c = vbOK Then
Dim sql, sql1 As String
Dim sql2 As Integer
sql = "insert into pstb values('" & Text1 & "','" & Text2 & "','" & DTPicker1 & "','" & Text3 & "'," & Label7.Caption & ",'" & Label8 & "','" & Label15 & "','" & Label17 & "','" & Label13 & "','" & Label14 & "')"
cnn.Execute (sql)
Adodc2.RecordSource = "select * from books where 条码号='" & Text2.Text & "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
sql1 = "update books set 复本数=' " & 复本数 - Val(Text3.Text) & "' where 条码号='" & Text2.Text & "'"
cnn.Execute (sql1)
sql2 = Val(Label8.Caption) - Val(Text3.Text)
sql1 = "update dzjstb set 借书数量='" & sql2 & "' where 读者编号='" & Text1.Text & "'"
cnn.Execute (sql1)
End If
Else
End If
Adodc3.RecordSource = "select * from pstb"
Adodc3.Refresh
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Label14.Caption = "丢失"
Label14.FontSize = 60
End Sub
Private Sub Command4_Click()
If Combo1.Text = "" Or Combo2.Text = "" Or Text4.Text = "" Then
MsgBox "请输入或选择查询条件", , "信息提示"
Else
If i = 1 Then
Adodc3.RecordSource = "select * from pstb where " + Combo1.Text + " like '%" + Text4.Text + "%'"
Adodc3.Refresh
ElseIf i = 0 Then
Adodc3.RecordSource = "select * from pstb where " + Combo1.Text + " " + Combo2.Text + " '" + Text4.Text + "'"
Adodc3.Refresh
End If
End If
End Sub
Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text3.SetFocus
End Sub
Private Sub Form_Load()
Set rs = New ADODB.Recordset
rs.Open "pstb", cnn, adOpenStatic, adLockOptimistic, adCmdTable
Me.Caption = Me.Caption & " " & frmmain.StatusBar1.Panels(2).Text
DTPicker1.Value = Date
End Sub
Private Sub Text1_Change()
Adodc1.RecordSource = "select * from dzjstb where 读者编号='" & Text1.Text & "'"
On Error Resume Next
Adodc1.Refresh
If Adodc1.Recordset.RecordCount < 0 Then
MsgBox "没有该读者信息!", vbOKOnly, "提示"
Text1.Text = ""
Text1.SetFocus
Text2.Text = ""
Label6.Caption = ""
Label7.Caption = ""
Label8.Caption = ""
Label15.Caption = ""
Label17.Caption = ""
Label13.Caption = ""
End If
Set rs = Nothing
If Text1.Text = "" Then
MsgBox "请先输入读者编号", vbOKOnly, "提示"
End If
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text2.SetFocus
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then DTPicker1.SetFocus
End Sub
Private Sub Text2_LostFocus()
If Text2.Text = "" Or Text1.Text = "" Then
MsgBox "请输入条码号和读者编号", , "信息提示"
Exit Sub
Else
Adodc1.RecordSource = "select * from dzjstb where 条码号='" & Text2.Text & "'and 读者编号='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Command1.Enabled = True
Text1.Text = Adodc1.Recordset.Fields(0)
Label6.Caption = Adodc1.Recordset.Fields(1)
Label7.Caption = Adodc1.Recordset.Fields(4)
Label8.Caption = Adodc1.Recordset.Fields(8)
Label15.Caption = Adodc1.Recordset.Fields(3)
Label17.Caption = Adodc1.Recordset.Fields(9)
Label13.Caption = Adodc1.Recordset.Fields(10)
Else
MsgBox "没有此读者的借书信息", vbOKOnly, "提示"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End If
End If
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call Command4_Click
Else
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -