📄 qureader.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form qureader
Caption = "读者查找"
ClientHeight = 6795
ClientLeft = 60
ClientTop = 465
ClientWidth = 9330
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6795
ScaleWidth = 9330
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmd_back
Caption = "返回"
Height = 495
Left = 5040
TabIndex = 15
Top = 5760
Width = 1815
End
Begin VB.CommandButton cmd_list
Caption = "列借书单"
Height = 495
Left = 2040
TabIndex = 14
Top = 5760
Width = 1815
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "qureader.frx":0000
Height = 2895
Left = 480
TabIndex = 13
Top = 2640
Width = 8535
_ExtentX = 15055
_ExtentY = 5106
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.Frame Frame1
Caption = "设置条件"
Height = 1695
Left = 480
TabIndex = 0
Top = 720
Width = 8535
Begin VB.CommandButton cmd_again
Caption = "重置"
Height = 375
Left = 3960
TabIndex = 12
Top = 1200
Width = 1815
End
Begin VB.CommandButton cmd_ok
Caption = "确定"
Height = 375
Left = 1680
TabIndex = 11
Top = 1200
Width = 1815
End
Begin VB.TextBox txtlevel
Height = 375
Left = 6240
MaxLength = 6
TabIndex = 10
Top = 720
Width = 1695
End
Begin VB.TextBox txtunit
Height = 375
Left = 4320
MaxLength = 20
TabIndex = 9
Top = 720
Width = 1695
End
Begin VB.TextBox txtsex
Height = 375
Left = 3000
MaxLength = 2
TabIndex = 8
Top = 720
Width = 1215
End
Begin VB.TextBox txtname
Height = 375
Left = 1440
MaxLength = 16
TabIndex = 7
Top = 720
Width = 1335
End
Begin VB.TextBox txtrno
Height = 375
Left = 240
MaxLength = 4
TabIndex = 6
Top = 720
Width = 975
End
Begin VB.Label Label5
Caption = "级别"
Height = 375
Left = 6240
TabIndex = 5
Top = 360
Width = 855
End
Begin VB.Label Label4
Caption = "单位"
Height = 375
Left = 4320
TabIndex = 4
Top = 360
Width = 855
End
Begin VB.Label Label3
Caption = "性别"
Height = 375
Left = 3000
TabIndex = 3
Top = 360
Width = 855
End
Begin VB.Label Label2
Caption = "姓名"
Height = 375
Left = 1440
TabIndex = 2
Top = 360
Width = 855
End
Begin VB.Label Label1
Caption = "借书证号"
Height = 375
Left = 240
TabIndex = 1
Top = 360
Width = 855
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 840
Top = 120
Visible = 0 'False
Width = 6375
_ExtentX = 11245
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = $"qureader.frx":0015
OLEDBString = $"qureader.frx":00A7
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from reader"
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
End
Attribute VB_Name = "qureader"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmd_again_Click()
txtrno.Text = ""
txtname.Text = ""
txtunit.Text = ""
txtlevel.Text = ""
txtsex.Text = ""
cmd_ok.Enabled = True
End Sub
Private Sub cmd_back_Click()
Unload Me
End Sub
Private Sub cmd_list_Click()
Dim strn As String
Dim txtsql As String
Dim rs As New ADODB.Recordset
no = Trim(Adodc1.Recordset.Fields("借书证号"))
txtsql = "select * from borrow where 借书证号='" + no + "'"
Set rs = exesql(txtsql)
If rs.RecordCount = 0 Then
MsgBox "改读者没有借书", vbOKOnly, "信息提示"
Else
strn = "书名(借书日期)" + Chr(10) + Chr(13)
Do While Not rs.EOF()
strn = strn & Trim(rs.Fields("书名")) & "(" & Format(rs.Fields("借书日期"), "yyyy.mm.dd") & ")" + Chr(10) + Chr(13)
rs.MoveNext
Loop
MsgBox strn, vbOKOnly, "列借图书清单"
rs.Close
End If
End Sub
Private Sub cmd_ok_Click()
Dim str As String
str = ""
If Trim(txtrno.Text) <> "" Then
If str = "" Then
str = "借书证号='" + Trim(txtrno.Text) + "'"
Else
str = str + "and 借书证号='" + Trim(txtrno.Text) + "'"
End If
End If
If Trim(txtname.Text) <> "" Then
If str = "" Then
str = "姓名='" + Trim(txtname.Text) + "'"
Else
str = str + "and 姓名='" + Trim(txtname.Text) + "'"
End If
End If
If Trim(txtunit.Text) <> "" Then
If str = "" Then
str = "单位='" + Trim(txtunit.Text) + "'"
Else
str = str + "and 单位='" + Trim(txtunit.Text) + "'"
End If
End If
If Trim(txtlevel.Text) <> "" Then
If str = "" Then
str = "级别='" + Trim(txtlevel.Text) + "'"
Else
str = str + "and 级别='" + Trim(txtlevel.Text) + "'"
End If
End If
If Trim(txtsex.Text) <> "" Then
If str = "" Then
str = "性别='" + Trim(txtsex.Text) + "'"
Else
str = str + "and 性别='" + Trim(txtsex.Text) + "'"
End If
End If
If str <> "" Then
Adodc1.RecordSource = "select * from reader where " + str
Adodc1.Refresh
Else
Adodc1.RecordSource = "select * from reader"
Adodc1.Refresh
End If
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "没有任何满足条件的记录", vbOKOnly, "信息提示"
End If
Call encomm
End Sub
Private Sub Form_Activate()
Adodc1.Refresh
DataGrid1.Refresh
DataGrid1.SetFocus
Call encomm
End Sub
Private Sub encomm()
If Adodc1.Recordset.RecordCount = 0 Then
cmd_ok.Enabled = False
Else
cmd_ok.Enabled = True
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -