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

📄 form10.frm

📁 这个是一个图书管理系统
💻 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 Form10 
   Caption         =   "还书"
   ClientHeight    =   7080
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   9555
   LinkTopic       =   "Form10"
   ScaleHeight     =   7080
   ScaleWidth      =   9555
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame4 
      Height          =   615
      Left            =   2640
      TabIndex        =   14
      Top             =   6000
      Width           =   5295
      Begin VB.CommandButton Command4 
         Caption         =   "取消"
         Height          =   375
         Left            =   3240
         TabIndex        =   16
         Top             =   120
         Width           =   1815
      End
      Begin VB.CommandButton Command3 
         Caption         =   "还书"
         Height          =   375
         Left            =   480
         TabIndex        =   15
         Top             =   120
         Width           =   1695
      End
   End
   Begin MSAdodcLib.Adodc Adodc2 
      Height          =   375
      Left            =   0
      Top             =   1800
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\图书管理系统\db1.mdb;Persist Security Info=False"
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\图书管理系统\db1.mdb;Persist Security Info=False"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from sjxx"
      Caption         =   "Adodc2"
      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
   Begin VB.Frame Frame3 
      Caption         =   "书籍信息"
      Height          =   3015
      Left            =   1680
      TabIndex        =   10
      Top             =   2760
      Width           =   7335
      Begin MSAdodcLib.Adodc Adodc3 
         Height          =   375
         Left            =   0
         Top             =   2640
         Width           =   7335
         _ExtentX        =   12938
         _ExtentY        =   661
         ConnectMode     =   0
         CursorLocation  =   3
         IsolationLevel  =   -1
         ConnectionTimeout=   15
         CommandTimeout  =   30
         CursorType      =   3
         LockType        =   3
         CommandType     =   8
         CursorOptions   =   0
         CacheSize       =   50
         MaxRecords      =   0
         BOFAction       =   0
         EOFAction       =   0
         ConnectStringType=   1
         Appearance      =   1
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Orientation     =   0
         Enabled         =   -1
         Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\图书管理系统\db1.mdb;Persist Security Info=False"
         OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\图书管理系统\db1.mdb;Persist Security Info=False"
         OLEDBFile       =   ""
         DataSourceName  =   ""
         OtherAttributes =   ""
         UserName        =   ""
         Password        =   ""
         RecordSource    =   "select * from dzxx"
         Caption         =   "Adodc3"
         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
      Begin MSDataGridLib.DataGrid DataGrid1 
         Bindings        =   "Form10.frx":0000
         Height          =   2415
         Left            =   0
         TabIndex        =   11
         Top             =   240
         Width           =   7335
         _ExtentX        =   12938
         _ExtentY        =   4260
         _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.Frame Frame2 
      Caption         =   "按书籍信息"
      Height          =   1215
      Left            =   1680
      TabIndex        =   5
      Top             =   1320
      Width           =   7335
      Begin VB.CommandButton Command2 
         Caption         =   "查询"
         Height          =   375
         Left            =   5640
         TabIndex        =   13
         Top             =   480
         Width           =   1335
      End
      Begin VB.ComboBox Combo4 
         DataSource      =   "Adodc2"
         Height          =   300
         Left            =   3720
         TabIndex        =   9
         Text            =   "Combo4"
         Top             =   480
         Width           =   1695
      End
      Begin VB.ComboBox Combo3 
         DataSource      =   "Adodc2"
         Height          =   300
         Left            =   840
         TabIndex        =   8
         Text            =   "Combo3"
         Top             =   480
         Width           =   1815
      End
      Begin VB.Label Label4 
         Caption         =   "图书名"
         Height          =   375
         Left            =   3000
         TabIndex        =   7
         Top             =   480
         Width           =   1215
      End
      Begin VB.Label Label3 
         Caption         =   "图书编号"
         Height          =   375
         Left            =   120
         TabIndex        =   6
         Top             =   480
         Width           =   1215
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "按读者信息"
      Height          =   1095
      Left            =   1680
      TabIndex        =   0
      Top             =   120
      Width           =   7335
      Begin VB.CommandButton Command1 
         Caption         =   "查询"
         Height          =   375
         Left            =   5640
         TabIndex        =   12
         Top             =   480
         Width           =   1335
      End
      Begin VB.ComboBox Combo2 
         DataSource      =   "Adodc1"
         Height          =   300
         Left            =   3840
         TabIndex        =   4
         Text            =   "Combo2"
         Top             =   480
         Width           =   1575
      End
      Begin VB.ComboBox Combo1 
         DataSource      =   "Adodc1"
         Height          =   300
         Left            =   960
         TabIndex        =   3
         Text            =   "Combo1"
         Top             =   480
         Width           =   1695
      End
      Begin VB.Label Label2 
         Caption         =   "读者姓名"
         Height          =   375
         Left            =   3000
         TabIndex        =   2
         Top             =   480
         Width           =   1815
      End
      Begin VB.Label Label1 
         Caption         =   "读者编号"
         Height          =   375
         Left            =   120
         TabIndex        =   1
         Top             =   480
         Width           =   1815
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   0
      Top             =   480
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\图书管理系统\db1.mdb;Persist Security Info=False"
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\图书管理系统\db1.mdb;Persist Security Info=False"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from dzxx"
      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 = "Form10"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Change()
Combo2.ListIndex = Combo1.ListIndex
End Sub

Private Sub Combo2_Change()
Combo1.ListIndex = Combo2.ListIndex
End Sub

Private Sub Combo3_Change()
Combo4.ListIndex = Combo3.ListIndex
End Sub

Private Sub Combo4_Change()
Combo3.ListIndex = Combo4.ListIndex
End Sub

Private Sub Command1_Click()
Dim rs_reader As New ADODB.Recordset
Dim sql As String
findform = True
Adodc3.RecordSource = "select * from jyxx where 读者姓名='" & Combo2.Text & "'"
Adodc3.Refresh
DataGrid1.ReBind
DataGrid1.AllowAddNew = False
DataGrid1.AllowDelete = False
DataGrid1.AllowUpdate = False
End Sub

Private Sub Command2_Click()
Dim rs_reader As New ADODB.Recordset
Dim sql As String
findform = True
Adodc3.RecordSource = "select * from jyxx where 书籍编号='" & Combo2.Text & "'"
Adodc3.Refresh
DataGrid1.ReBind
DataGrid1.AllowAddNew = False
DataGrid1.AllowDelete = False
DataGrid1.AllowUpdate = False
End Sub

Private Sub Command3_Click()
Dim book_num As String
Dim reader_num As String
Dim answer As String
Dim rs_back As New ADODB.Recordset
Dim sql As String
On Error GoTo delerror
If Not Adodc3.Recordset.EOF And Adodc3.Recordset.BOF Then
book_num = DataGrid1.Columns(3).CellValue(DataGrid1.Bookmark)
reader_num = DataGrid1.Columns(1).CellValue(DataGrid1.Bookmark)
Else
Exit Sub
End If
answer = MsgBox("确定要还这本书吗?", vbYesNo, "")
If answer = vbYes Then
Adodc2.RecordSource = "select * from sjxx where 书籍编号='" & book_num & "'"
Adodc2.Refresh
Adodc2.Recordset.Fields(7) = "否"
Adodc2.Recordset.Update
Adodc1.RecordSource = "select * from dzxx where 读者编号='" & reader_num & "'"
Adodc1.Refresh
Adodc1.Recordset.Fields(8) = Adodc1.Recordset.Fields(8) - 1
Adodc1.Recordset.Update
Adodc3.Recordset.Delete
If Not (Adodc3.Recordset.EOF And Adodc3.Recordset.BOF) Then
Adodc3.Recordset.Update
DataGrid1.ReBind
End If
MsgBox "成功删除!", vbOKOnly + vbExclamation, ""
Else
Exit Sub
End If
delerror:
If Err.Number <> 0 Then
Debug.Print Err.Number
MsgBox Err.Description
End If
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Form_Load()
Dim i As Integer
Combo1.Clear
Combo2.Clear
Adodc1.Recordset.MoveFirst
For i = 0 To Adodc1.Recordset.RecordCount - 1
Combo1.AddItem Adodc1.Recordset.Fields(1).Value
Combo2.AddItem Adodc1.Recordset.Fields(0).Value
Adodc1.Recordset.MoveNext
Next
Combo1.ListIndex = 0
Combo2.ListIndex = 0
Combo3.Clear
Combo4.Clear
Adodc2.Recordset.MoveFirst
For i = 0 To Adodc2.Recordset.RecordCount - 1
Combo3.AddItem Adodc2.Recordset.Fields(0).Value
Combo4.AddItem Adodc2.Recordset.Fields(1).Value
Adodc2.Recordset.MoveNext
Next
Combo3.ListIndex = 0
Combo4.ListIndex = 0
End Sub

⌨️ 快捷键说明

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