【VB开源代码栏目提醒】:网学会员鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“frmfindborrowinfo.frm”一文,供大家参考学习
VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmfindborrowinfo
Caption = "查询借书信息"
ClientHeight = 9045
ClientLeft = 60
ClientTop = 450
ClientWidth = 10860
LinkTopic = "Form2"
MaxButton = 0 'False
ScaleHeight = 9045
ScaleWidth = 10860
StartUpPosition = 2 '屏幕中心
WindowState = 2 'Maximized
Begin VB.Frame Frame2
Caption = "查询结果"
Height = 5895
Left = 600
TabIndex = 7
Top = 2760
Width = 9735
Begin MSDataGridLib.DataGrid DataGrid1
Height = 5295
Left = 240
TabIndex = 8
Top = 360
Width = 9255
_ExtentX = 16325
_ExtentY = 9340
_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
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 5880
TabIndex = 6
Top = 2160
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "开始查询"
Height = 495
Left = 3000
TabIndex = 5
Top = 2160
Width = 1575
End
Begin VB.Frame Frame1
Height = 1695
Left = 600
TabIndex = 0
Top = 240
Width = 9735
Begin VB.TextBox Text1
Height = 375
Left = 4440
TabIndex = 4
Top = 960
Width = 2655
End
Begin
VB.OptionButton Option3
Caption = "按读者
查询"
Height = 495
Left = 1920
TabIndex = 3
Top = 960
Width = 1815
End
Begin VB.OptionButton Option2
Caption = "查询未借出图书"
Height = 375
Left = 4800
TabIndex = 2
Top = 360
Width = 1695
End
Begin VB.OptionButton Option1
Caption = "查询已借出图书"
Height = 495
Left = 1920
TabIndex = 1
Top = 240
Width = 1695
End
End
End
Attribute VB_Name = "frmfindborrowinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim sql As String
Dim rs_find As New ADODB.Recordset
If Option1.Value = True Then
sql = "select * from 书籍信息 where 是否被借出='是'"
End If
If Option2.Value = True Then
sql = "select * from 书籍信息 where 是否被借出='否'"
End If
If Option3.Value = True Then
sql = "select * from 借阅信息 where 读者='" & Text1.Text & "'"
End If
rs_find.CursorLocation = adUseClient
rs_find.Open sql, conn, adOpenKeyset, adLockPessi
mistic
DataGrid1.AllowAddNew = False
DataGrid1.AllowDelete = False
DataGrid1.AllowUpdate = False
Set DataGrid1.DataSource = rs_find
End Sub
Private Sub Command2_Click()
Unload Me
End Sub