⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frm_singlequery.frm

📁 关于图书馆管理的vfp程序
💻 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 Frm_SingleQuery 
   AutoRedraw      =   -1  'True
   Caption         =   "单条件查询"
   ClientHeight    =   8595
   ClientLeft      =   1035
   ClientTop       =   1725
   ClientWidth     =   11610
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   8595
   ScaleWidth      =   11610
   Begin VB.CommandButton Cmd_Quit 
      Caption         =   "退出"
      Height          =   495
      Left            =   8595
      TabIndex        =   14
      Top             =   7920
      Width           =   1455
   End
   Begin VB.Frame Fra_Year 
      Caption         =   "年份"
      Height          =   855
      Left            =   10200
      TabIndex        =   11
      Top             =   120
      Width           =   1335
      Begin VB.OptionButton Opt_Dec 
         Caption         =   "降序"
         Height          =   180
         Left            =   240
         TabIndex        =   13
         Top             =   580
         Width           =   975
      End
      Begin VB.OptionButton Opt_Asc 
         Caption         =   "升序"
         Height          =   255
         Left            =   240
         TabIndex        =   12
         Top             =   245
         Width           =   975
      End
   End
   Begin VB.CommandButton Cmd_DoOrder 
      Caption         =   "借/还图书"
      Height          =   495
      Left            =   4230
      TabIndex        =   10
      Top             =   7920
      Width           =   1455
   End
   Begin VB.CommandButton Cmd_BookRecord 
      Caption         =   "流通记录"
      Height          =   495
      Left            =   7140
      TabIndex        =   9
      Top             =   7920
      Width           =   1455
   End
   Begin VB.CommandButton Cmd_ClearList 
      Caption         =   "清空列表"
      Height          =   495
      Left            =   5685
      TabIndex        =   8
      Top             =   7920
      Width           =   1455
   End
   Begin VB.CommandButton Cmd_CardInfo 
      Caption         =   "卡片信息"
      Height          =   495
      Left            =   2775
      TabIndex        =   7
      Top             =   7920
      Width           =   1455
   End
   Begin VB.CommandButton Cmd_Print 
      Caption         =   "打印"
      Height          =   495
      Left            =   1320
      TabIndex        =   6
      Top             =   7920
      Width           =   1455
   End
   Begin VB.Frame Frame2 
      Caption         =   "功能框"
      Height          =   855
      Left            =   120
      TabIndex        =   5
      Top             =   7680
      Width           =   11415
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Bindings        =   "Frm_SingleQuery.frx":0000
      Height          =   6615
      Left            =   120
      TabIndex        =   4
      Top             =   1080
      Width           =   11415
      _ExtentX        =   20135
      _ExtentY        =   11668
      _Version        =   393216
      HeadLines       =   1
      RowHeight       =   15
      FormatLocked    =   -1  'True
      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     =   7
      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
      BeginProperty Column02 
         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 Column03 
         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 Column04 
         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 Column05 
         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 Column06 
         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 
            ColumnWidth     =   1844.787
         EndProperty
         BeginProperty Column02 
         EndProperty
         BeginProperty Column03 
         EndProperty
         BeginProperty Column04 
         EndProperty
         BeginProperty Column05 
            ColumnWidth     =   1409.953
         EndProperty
         BeginProperty Column06 
            ColumnWidth     =   2039.811
         EndProperty
      EndProperty
   End
   Begin VB.CommandButton Cmd_Query 
      Caption         =   "搜 索"
      Height          =   495
      Left            =   7080
      TabIndex        =   3
      Top             =   360
      Width           =   1335
   End
   Begin VB.Frame Frame1 
      Caption         =   "单条件模糊查询"
      Height          =   855
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   9975
      Begin VB.CommandButton cmdMultiQuery 
         Caption         =   "多条件查询"
         Height          =   495
         Left            =   8520
         TabIndex        =   15
         Top             =   240
         Width           =   1335
      End
      Begin VB.ComboBox Cbo_Query 
         Height          =   300
         ItemData        =   "Frm_SingleQuery.frx":0015
         Left            =   1320
         List            =   "Frm_SingleQuery.frx":002B
         Style           =   2  'Dropdown List
         TabIndex        =   2
         Top             =   345
         Width           =   1215
      End
      Begin VB.TextBox Tex_Query 
         Height          =   495
         Left            =   3960
         TabIndex        =   1
         Top             =   240
         Width           =   2895
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "输入检索值"
         Height          =   180
         Left            =   2880
         TabIndex        =   17
         Top             =   360
         Width           =   900
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "选择检索条件"
         Height          =   180
         Left            =   120
         TabIndex        =   16
         Top             =   360
         Width           =   1080
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   735
      Left            =   9960
      Top             =   7800
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   1296
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      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
Attribute VB_Name = "Frm_SingleQuery"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Qfield As String
Dim Tex As String
Public bBorrow As Boolean
Dim RowPostion As Integer

Private Sub Cbo_Query_LostFocus()
Qfield = Cbo_Query.Text
Tex_Query.SetFocus
End Sub

Private Sub Cmd_BookRecord_Click()
Frm_CirculationInfo.Show
End Sub

Private Sub Cmd_CardInfo_Click()
Frm_BookRecordShow.Show
End Sub

Private Sub Cmd_ClearList_Click()
SQL = "select * from 书籍资料  where 书名 =" & "''"
Adodc1.RecordSource = SQL
Adodc1.Refresh
Cmd_CardInfo.Enabled = False
Cmd_Print.Enabled = False
Cmd_DoOrder.Enabled = False
Cmd_BookRecord.Enabled = False
End Sub

Private Sub Cmd_DoOrder_Click()
bBorrow = True
Frm_Mainpage.Login_Click
End Sub

Private Sub Cmd_Print_Click()
Frm_Mainpage.Print_Click
End Sub

Private Sub Cmd_Query_Click()
Dim mpath As String
Qfield = Cbo_Query.Text
SQL = "select * from 书籍资料  where " & Qfield & " like '" & "%" & Tex & "%'"
If Tex = "" Then
    Cmd_ClearList_Click
Else
    If Opt_Asc.Value = True Then
        Adodc1.RecordSource = SQL & " order by 出版年份 "
    ElseIf Opt_Dec.Value Then
        Adodc1.RecordSource = SQL & "order by 出版年份 desc"
    Else
        Adodc1.RecordSource = SQL
    End If
    Adodc1.Refresh
End If
If Adodc1.Recordset.EOF Then
    MsgBox "找不到相关记录!", , "提示"
    Tex_Query = ""
    Tex_Query.SetFocus
Else
    Cmd_CardInfo.Enabled = True
    Cmd_Print.Enabled = True
    Cmd_DoOrder.Enabled = True
    Cmd_BookRecord.Enabled = True
End If
End Sub

Private Sub Cmd_Quit_Click()
Unload Me
Frm_Mainpage.Show
End Sub

Private Sub cmdMultiQuery_Click()
Frm_MutiQuery.Show
Me.Hide
End Sub

Private Sub DataGrid1_Click()
RowPosition = DataGrid1.Row
End Sub

Private Sub Form_Load()
Dim mpath As String
bBorrow = False
Cmd_CardInfo.Enabled = False
Cmd_Print.Enabled = False
Cmd_DoOrder.Enabled = False
Cmd_BookRecord.Enabled = False
Cbo_Query.Text = "书名"
mpath = App.Path
If (Right(mpath, 1) <> " \") Then mpath = mpath + "\"
    mlink = "provider=microsoft.jet.oledb.3.51;data source=" + mpath + "book.mdb"
    Adodc1.ConnectionString = mlink
    Adodc1.CommandType = adCmdUnknown
End Sub

Private Sub Opt_Asc_Click()
If SQL <> "" Then
    If Opt_Asc.Value = True Then
        Adodc1.RecordSource = SQL & "order by 出版年份 "
        Adodc1.Refresh
    End If
End If
End Sub

Private Sub Opt_Dec_Click()
If SQL <> "" Then
    If Opt_Dec.Value = True Then
        Adodc1.RecordSource = SQL & "order by 出版年份 DESC"
        Adodc1.Refresh
    End If
End If
End Sub

Private Sub Tex_Query_LostFocus()
Tex = Tex_Query.Text
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -