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

📄 frmfindbook.frm

📁 VB+SQL写的图书管理系统,用了ACTIVESKIN界面,请自行下载该控件
💻 FRM
字号:
VERSION 5.00
Object = "{74848F95-A02A-4286-AF0C-A3C755E4A5B3}#1.0#0"; "actskn43.ocx"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmfindbookinfo 
   Caption         =   "图书信息管理"
   ClientHeight    =   6990
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   9840
   LinkTopic       =   "Form1"
   ScaleHeight     =   6990
   ScaleWidth      =   9840
   StartUpPosition =   2  '屏幕中心
   Begin MSDataGridLib.DataGrid DataGrid1 
      Height          =   3975
      Left            =   120
      TabIndex        =   13
      Top             =   2160
      Width           =   9615
      _ExtentX        =   16960
      _ExtentY        =   7011
      _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
   Begin VB.CommandButton Command3 
      Caption         =   "借这本书"
      Height          =   495
      Left            =   3600
      TabIndex        =   12
      Top             =   6240
      Width           =   2775
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   495
      Left            =   5640
      TabIndex        =   11
      Top             =   1560
      Width           =   1335
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   495
      Left            =   3000
      TabIndex        =   10
      Top             =   1560
      Width           =   1335
   End
   Begin VB.TextBox Text4 
      Height          =   375
      Left            =   6000
      TabIndex        =   9
      Top             =   840
      Width           =   3615
   End
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   6000
      TabIndex        =   8
      Top             =   240
      Width           =   3615
   End
   Begin VB.CheckBox Check5 
      Caption         =   "出版社"
      Height          =   375
      Left            =   5040
      TabIndex        =   7
      Top             =   840
      Width           =   855
   End
   Begin VB.CheckBox Check4 
      Caption         =   "编号"
      Height          =   375
      Left            =   5040
      TabIndex        =   6
      Top             =   240
      Width           =   855
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   1200
      TabIndex        =   5
      Top             =   840
      Width           =   1455
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   3360
      TabIndex        =   4
      Top             =   840
      Width           =   1455
   End
   Begin VB.CheckBox Check3 
      Caption         =   "作者"
      Height          =   375
      Left            =   2640
      TabIndex        =   3
      Top             =   840
      Width           =   735
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1200
      TabIndex        =   2
      Top             =   240
      Width           =   3615
   End
   Begin VB.CheckBox Check2 
      Caption         =   "图书类别"
      Height          =   375
      Left            =   120
      TabIndex        =   1
      Top             =   840
      Width           =   1215
   End
   Begin VB.CheckBox Check1 
      Caption         =   "书名"
      Height          =   375
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   975
   End
   Begin ACTIVESKINLibCtl.Skin Skin1 
      Left            =   0
      OleObjectBlob   =   "frmfindbook.frx":0000
      Top             =   0
   End
End
Attribute VB_Name = "frmfindbookinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim panduan As String

Private Sub Command1_Click()
Dim rs_findbook 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(Combo1.Text & " ") & "'"
  Else
    sql = sql & "and 类别='" & Trim(Combo1.Text & " ") & "'"
  End If
End If
If Check3.Value = vbChecked Then
  If Trim(sql) = "" Then
    sql = "作者='" & Trim(Text2.Text & " ") & "'"
  Else
    sql = sql & "and 作者='" & Trim(Text2.Text & " ") & "'"
  End If
End If
If Check4.Value = vbChecked Then
  If Trim(sql) = "" Then
    sql = "图书编号='" & Trim(Text3.Text & " ") & "'"
  Else
    sql = sql & "and 图书编号='" & Trim(Text3.Text & " ") & "'"
  End If
End If
If Check5.Value = vbChecked Then
  If Trim(sql) = "" Then
    sql = "出版社='" & Trim(Text4.Text & " ") & "'"
  Else
    sql = sql & "and 出版社='" & Trim(Text4.Text & " ") & "'"
  End If
End If
If Trim(sql) = "" Then
  MsgBox "请选择查询方式!", vbOKOnly + vbExclamation
  Exit Sub
End If
sql = "select * from 书籍信息 where " & sql
rs_findbook.CursorLocation = adUseClient
rs_findbook.Open sql, conn, adOpenKeyset, adLockPessimistic
DataGrid1.AllowAddNew = False
DataGrid1.AllowDelete = False
DataGrid1.AllowUpdate = False
If rs_findbook.RecordCount = 0 Then
  MsgBox "查询不到该图书信息!", vbOKOnly + vbExclamation
Else
  Set DataGrid1.DataSource = rs_findbook
End If
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Command3_Click()
 If Trim(book_num) = "" Then
   MsgBox "请选择要借阅的图书!", vbOKOnly + vbExclamation
   Exit Sub
 End If
 If panduan = "是" Then
   MsgBox "此书已被借出!", vbOKOnly + vbExclamation
   Exit Sub
 End If
 Unload Me
frmborrowbook.Show
End Sub

Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
  book_num = DataGrid1.Columns(0).CellValue(DataGrid1.Bookmark)
  panduan = DataGrid1.Columns(7).CellValue(DataGrid1.Bookmark)
End Sub

Private Sub Form_Load()
Dim skn
skn = App.Path & "\Book.skn"

'载入时的一些脚本.
Skin1.LoadSkin skn
Skin1.ApplySkin Me.hWnd ' 应用皮肤到这个窗口和它的子控件中
Dim rs_find As New ADODB.Recordset
 Dim sql As String
 sql = "select * from 图书类别"
 rs_find.Open sql, conn, adOpenKeyset, adLockPessimistic
 rs_find.MoveFirst
 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

⌨️ 快捷键说明

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