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

📄 frmborrow.frm

📁 有读者和图书信息的添加查询,借还书等,先建立数据库和ODBC数据源
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmBorrow 
   Caption         =   "借书信息列表"
   ClientHeight    =   4335
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   7380
   LinkTopic       =   "Form1"
   ScaleHeight     =   4335
   ScaleWidth      =   7380
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton cmdExit 
      Caption         =   "返回(&X)"
      Height          =   375
      Left            =   3000
      TabIndex        =   2
      Top             =   3480
      Width           =   855
   End
   Begin MSFlexGridLib.MSFlexGrid msglist 
      Height          =   2295
      Left            =   360
      TabIndex        =   1
      Top             =   960
      Width           =   6615
      _ExtentX        =   11668
      _ExtentY        =   4048
      _Version        =   393216
   End
   Begin VB.Label lblTitle 
      Caption         =   "借  书  信  息  列  表"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   0
      Top             =   360
      Width           =   3015
   End
End
Attribute VB_Name = "frmBorrow"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public txtSQL As String
Dim mrc As ADODB.Recordset
Dim msgtext As String

Private Sub ShowTitle()
    Dim i As Integer
    Select Case brflagadd
    Case 3
       With msglist
       .Cols = 6
        For i = 0 To 5
           .ColWidth(i) = 1000
           .ColAlignment(i) = 0
       Next i
        .TextMatrix(0, 0) = "借书证号"
        .TextMatrix(0, 1) = "姓名"
        .TextMatrix(0, 2) = "ISBN"
        .TextMatrix(0, 3) = "书名"
        .TextMatrix(0, 4) = "索书号"
        .TextMatrix(0, 5) = "借书日期"
        .FixedRows = 1
        .FillStyle = flexFillRepeat
        .Col = 0
        .Row = 0
        .RowSel = 1
        .ColSel = .Cols - 1
        .CellAlignment = 4
         .Row = 1
         End With
     Case 4
        With msglist
       .Cols = 7
        For i = 0 To 6
           .ColWidth(i) = 1000
           .ColAlignment(i) = 0
        Next i
        .TextMatrix(0, 0) = "借书证号"
        .TextMatrix(0, 1) = "姓名"
        .TextMatrix(0, 2) = "ISBN"
        .TextMatrix(0, 3) = "书名"
        .TextMatrix(0, 4) = "索书号"
        .TextMatrix(0, 5) = "借书日期"
        .TextMatrix(0, 6) = "还书日期"
        .FixedRows = 1
        .FillStyle = flexFillRepeat
        .Col = 0
        .Row = 0
        .RowSel = 1
        .ColSel = .Cols - 1
        .CellAlignment = 4
         .Row = 1
         End With
     End Select
End Sub

Private Sub ShowData()
    Dim j As Integer
    Dim i As Integer
    Set mrc = ExecuteSQL(txtSQL, msgtext)
        With msglist
        .Rows = 1
        
        Do While Not mrc.EOF
            .Rows = .Rows + 1
            For i = 1 To mrc.Fields.Count
                Select Case mrc.Fields(i - 1).Type
                    Case adDBDate
                        .TextMatrix(.Rows - 1, i - 1) = Format(mrc.Fields(i - 1) & "", "yyyy-mm-dd")
                    Case Else
                        .TextMatrix(.Rows - 1, i - 1) = mrc.Fields(i - 1) & ""
                End Select
            Next i
            mrc.MoveNext
        Loop
    End With
    mrc.Close
End Sub

Private Sub cmdExit_Click()
        Unload Me
End Sub

Private Sub Form_Load()
        ShowTitle
        ShowData
End Sub

⌨️ 快捷键说明

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