📄 frmreaderl.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 frmreaderL
BorderStyle = 1 'Fixed Single
Caption = "读者借阅查询"
ClientHeight = 5955
ClientLeft = 45
ClientTop = 435
ClientWidth = 7590
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5955
ScaleWidth = 7590
Begin VB.Frame Frame3
Height = 1455
Left = 2760
TabIndex = 4
Top = 4440
Width = 4695
Begin VB.CommandButton Command3
Caption = "关闭(&C)"
Height = 375
Left = 3360
TabIndex = 9
Top = 960
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "清空(&Q)"
Height = 375
Left = 2040
TabIndex = 8
Top = 960
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "查询(&F)"
Height = 375
Left = 720
TabIndex = 7
Top = 960
Width = 1215
End
Begin VB.TextBox Text1
Height = 375
Left = 1440
TabIndex = 6
Top = 240
Width = 1815
End
Begin VB.Label Label1
AutoSize = -1 'True
Height = 180
Left = 360
TabIndex = 5
Top = 480
Width = 90
End
End
Begin VB.Frame Frame2
Height = 1455
Left = 120
TabIndex = 1
Top = 4440
Width = 2535
Begin VB.OptionButton Option2
Caption = "按姓名查询"
Height = 375
Left = 240
TabIndex = 3
Top = 840
Width = 1695
End
Begin VB.OptionButton Option1
Caption = "按编号查询"
Height = 375
Left = 240
TabIndex = 2
Top = 240
Width = 1815
End
End
Begin VB.Frame Frame1
Caption = "查询结果"
Height = 4215
Left = 120
TabIndex = 0
Top = 120
Width = 7335
Begin MSDataGridLib.DataGrid DataGrid1
Height = 3855
Left = 0
TabIndex = 10
Top = 240
Width = 7215
_ExtentX = 12726
_ExtentY = 6800
_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 MSAdodcLib.Adodc Adodc1
Height = 855
Left = 1920
Top = 1560
Visible = 0 'False
Width = 3255
_ExtentX = 5741
_ExtentY = 1508
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 = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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
End
Attribute VB_Name = "frmreaderL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim StrSQL As String
If Text1.Text = "" Then
MsgBox "请输入查询内容", vbInformation + vbOKOnly, "警告"
Text1.SetFocus
Exit Sub
End If
If Option1.Value = False And Option2.Value = False Then
MsgBox "请选择查询方式", vbInformation + vbOKOnly, "警告"
Option1.Value = True
Exit Sub
End If
If Option1.Value = True Then
StrSQL = "select bookinfo.书籍名称,booktype.书籍类别,lentinfo.书籍编号, " _
& " bookinfo.出版社,bookinfo.书籍页码,lentinfo.借书日期,lentinfo.还书日期," _
& " lentinfo.超出天数,lentinfo.罚款金额" _
& " from bookinfo,booktype,lentinfo" _
& " where bookinfo.书籍编号=lentinfo.书籍编号 and " _
& " lentinfo.读者编号='" & Text1.Text & "' and bookinfo.类别代码=booktype.类别代码 "
End If
If Option2.Value = True Then
StrSQL = "select bookinfo.书籍名称,booktype.书籍类别,lentinfo.书籍编号, " _
& " bookinfo.出版社,bookinfo.书籍页码,lentinfo.借书日期,lentinfo.还书日期," _
& " lentinfo.超出天数,lentinfo.罚款金额" _
& " from bookinfo,readerinfo,booktype,lentinfo" _
& " where readerinfo.读者编号=lentinfo.读者编号 and bookinfo.书籍编号=lentinfo.书籍编号 and " _
& " readerinfo.读者姓名 ='" & Text1.Text & "' and bookinfo.类别代码=booktype.类别代码 "
End If
Adodc1.RecordSource = StrSQL
Adodc1.Refresh
If Adodc1.Recordset.RecordCount <= 0 Then
MsgBox "对不起,你所查询的读者并不存在,请核对后再查询!", vbInformation + vbOKOnly, "警告"
Text1.Text = ""
Option1.Value = False
Option2.Value = False
Text1.SetFocus
Exit Sub
End If
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Command2_Click()
Option1.Value = False
Option2.Value = False
Text1.Text = ""
Text1.SetFocus
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
dbl
Adodc1.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=" _
& App.Path & "\db2.mdb;Mode=ReadWrite;persist security info=true;Jet OLEDB:Database Password=xgg2213"
Adodc1.CursorLocation = adUseClient
Adodc1.CommandType = adCmdText
End Sub
Private Sub Option1_Click()
Label1.Caption = "按编号查询"
End Sub
Private Sub Option2_Click()
Label1.Caption = "按姓名查询"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -