【VB开源代码栏目提醒】:网学会员为需要VB开源代码的朋友们搜集整理了D图书检索.frm相关资料,希望对各位网友有所帮助!
VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmBookSearch
Caption = "图书检索"
ClientHeight = 5070
ClientLeft = 60
ClientTop = 345
ClientWidth = 8670
LinkTopic = "Form1"
ScaleHeight = 5070
ScaleWidth = 8670
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton CmdQuery
Caption = "查询"
Height = 375
Left = 7320
TabIndex = 17
Top = 3240
Width = 855
End
Begin VB.Frame Frame1
Caption = "图书信息"
Height = 4755
Index = 0
Left = 120
TabIndex = 0
Top = 60
Width = 8355
Begin VB.CommandButton CmdExit
BackColor = &H00C0C0C0&
Caption = "退出"
Height = 360
Left = 7200
Style = 1 'Graphical
TabIndex = 18
Top = 3840
Width = 855
End
Begin VB.Frame Frame3
Caption = "查询"
Height = 1815
Left = 180
TabIndex = 1
Top = 2820
Width = 7935
Begin VB.CheckBox chkPubNo
Caption = "版次:"
Height = 375
Left = 3840
TabIndex = 16
Top = 1200
Width = 855
End
Begin VB.CheckBox chkAuthor
Caption = "作者:"
Height = 375
Left = 3840
TabIndex = 15
Top = 720
Width = 975
End
Begin VB.CheckBox chkPublisher
Caption = "出版社:"
Height = 375
Left = 240
TabIndex = 14
Top = 1200
Width = 1095
End
Begin VB.CheckBox chkName
Caption = "题名:"
Height = 255
Left = 240
TabIndex = 13
Top = 720
Width = 855
End
Begin VB.CheckBox chkISBN
Caption = "ISBN号:"
Height = 375
Left = 3840
TabIndex = 12
Top = 240
Width = 1095
End
Begin VB.TextBox txtPubNo
Height = 375
Left = 4920
MaxLength = 18
TabIndex = 9
Top = 1200
Width = 1935
End
Begin
VB.TextBox txtPublisher
Height = 375
Left = 1320
MaxLength = 18
TabIndex = 8
Top = 1200
Width = 1695
End
Begin VB.TextBox txtBookNo
Height = 375
Left = 1320
MaxLength = 12
TabIndex = 7
Top = 240
Width = 1695
End
Begin VB.TextBox txtName
Height = 375
Left = 1320
MaxLength = 18
TabIndex = 6
Top = 720
Width = 1695
End
Begin VB.TextBox txtAuthor
Height = 375
Left = 4920
MaxLength = 18
TabIndex = 5
Top = 720
Width = 1935
End
Begin VB.TextBox txtISBN
Height = 375
Left = 4920
TabIndex = 4
Top = 240
Width = 1935
End
Begin VB.CheckBox chkBookNo
Caption = "图书号:"
Height = 255
Left = 0
TabIndex = 3
Top = 300
Width = 1575
End
Begin VB.Label Label7
Height = 375
Index = 1
Left = 3840
TabIndex = 11
Top = 1920
Width = 615
End
Begin VB.Label Label7
Height = 255
Index = 0
Left = 3840
TabIndex = 10
Top = 1440
Width = 735
End
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 2415
Left = 180
TabIndex = 2
Top = 300
Width = 7935
_ExtentX = 13996
_ExtentY = 4260
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "图书信息
列表"
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
End
End
Attribute VB_Name = "frmBookSearch"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As ADODB.Recordset
Dim SQL As String
Dim msg As String
Private Sub CmdQuery_Click()
'
查询图书信息
Call LoadData '装载数据
End Sub
Private Sub Form_Load()
Call LoadData '装载数据
End Sub
Private Sub LoadData()
'装载数据
'得到查询条件,构建条件
Dim strWhere As String
strWhere = " where 1=1"
'如果图书号被选中
If chkBookNo.Value = 1 Then
strWhere = strWhere & " and bookID like '%" & Trim(txtBookNo.Text) & "%'"
End If
'如果ISBN被选中
If chkISBN.Value =