【VB开源代码栏目提醒】:网学会员为需要VB开源代码的朋友们搜集整理了frmfindreader.frm相关资料,希望对各位网友有所帮助!
VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmfindreader
Caption = "
查询读者信息"
ClientHeight = 8625
ClientLeft = 60
ClientTop = 450
ClientWidth = 11985
LinkTopic = "Form2"
MaxButton = 0 'False
ScaleHeight = 8625
ScaleWidth = 11985
StartUpPosition = 2 '屏幕中心
WindowState = 2 'Maximized
Begin VB.Frame Frame1
Height = 6615
Left = 240
TabIndex = 8
Top = 1680
Width = 10935
Begin MSDataGridLib.DataGrid DataGrid1
Height = 6135
Left = 240
TabIndex = 9
Top = 240
Width = 10695
_ExtentX = 18865
_ExtentY = 10821
_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 = 6480
TabIndex = 7
Top = 1080
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 495
Left = 4440
TabIndex = 6
Top = 1080
Width = 1095
End
Begin VB.ComboBox Combo1
Height = 300
Left = 9480
Style = 2 'Dropdown List
TabIndex = 5
Top = 480
Width = 1935
End
Begin VB.TextBox Text2
Height = 375
Left = 5640
TabIndex = 4
Top = 480
Width = 1935
End
Begin
VB.TextBox Text1
Height = 375
Left = 1920
TabIndex = 3
Top = 480
Width = 1935
End
Begin VB.CheckBox Check3
Caption = "读者种类"
Height = 495
Left = 8160
TabIndex = 2
Top = 360
Width = 1695
End
Begin VB.CheckBox Check2
Caption = "读者"
Height = 375
Left = 4440
TabIndex = 1
Top = 480
Width = 1575
End
Begin VB.CheckBox Check1
Caption = "读者编号"
Height = 255
Left = 720
TabIndex = 0
Top = 480
Width = 1575
End
End
Attribute VB_Name = "frmfindreader"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim rs_findreader As New ADODB.Recordset
Dim sql As String
If Check1.Value = vbChecked Then
sql = "读者编号='" & Trim(Text1.Text & " ") & "'"
End If
If Check2.Value = vbChecked Then
If Trim(sql) = "" Then
sql = "读者='" & Trim(Text2.Text & " ") & "'"
Else
sql = sql & "and 读者='" & Trim(Text2.Text & " ") & "'"
End If
End If
If Check3.Value = vbChecked Then
If Trim(sql) = "" Then
sql = "读者类别='" & Trim(Combo1.Text & " ") & "'"
Else
sql = sql & "and 读者类别='" & Trim(Combo1.Text & " ") & "'"
End If
End If
sql = "select * from 读者信息 where " & sql
rs_findreader.CursorLocation = adUseClient
rs_findreader.Open sql, conn, adOpenKeyset, adLockPessimistic
DataGrid1.AllowAddNew = False
DataGrid1.AllowDelete = False
DataGrid1.AllowUpdate = False
Set DataGrid1.DataSource = rs_findreader
'rs_findreader.Close
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim rs_find As New ADODB.Recordset
Dim sql As String
sql = "select * from 读者类别"
rs_find.Open sql, conn, adOpenKeyset, adLockPessi
mistic
If Not rs_find.EOF Then
Do While Not rs_find.EOF
Combo1.AddItem rs_find.Fields(0)
rs_find.MoveNext
Loop
Combo1.ListIndex = 0
End If
rs_find.Close
End Sub