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

📄 retbk.frm

📁 图书馆管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form retbk 
   BackColor       =   &H8000000D&
   Caption         =   "读者还书"
   ClientHeight    =   3225
   ClientLeft      =   4920
   ClientTop       =   1800
   ClientWidth     =   4755
   LinkTopic       =   "Form1"
   ScaleHeight     =   3225
   ScaleWidth      =   4755
   Begin MSAdodcLib.Adodc Adodc3 
      Height          =   375
      Left            =   -360
      Top             =   1920
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _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=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=图书管理数据库;Data Source=(local)"
      OLEDBString     =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=图书管理数据库;Data Source=(local)"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select 图书编号,借书日期 from  图书借阅表"
      Caption         =   "Adodc3"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc2 
      Height          =   330
      Left            =   -360
      Top             =   1440
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   582
      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=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=图书管理数据库;Data Source=(local)"
      OLEDBString     =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=图书管理数据库;Data Source=(local)"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select 书名 from 图书借阅表 where 还书日期 is null"
      Caption         =   "Adodc2"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton Command3 
      Caption         =   "返回"
      Height          =   495
      Left            =   3840
      TabIndex        =   8
      Top             =   2640
      Width           =   735
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   375
      Left            =   1680
      TabIndex        =   7
      Top             =   2520
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "还书"
      Height          =   375
      Left            =   360
      TabIndex        =   6
      Top             =   2520
      Width           =   975
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   -360
      Top             =   960
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   582
      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         =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=图书管理数据库;Data Source=(local)"
      OLEDBString     =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=图书管理数据库;Data Source=(local)"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select distinct 读者编号 from  图书借阅表 where 还书日期 is  null "
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSDataListLib.DataCombo DataCombo1 
      Bindings        =   "retbk.frx":0000
      DataSource      =   "Adodc1"
      Height          =   315
      Left            =   360
      TabIndex        =   1
      Top             =   600
      Width           =   1575
      _ExtentX        =   2778
      _ExtentY        =   556
      _Version        =   393216
      ListField       =   "读者编号"
      Text            =   ""
   End
   Begin MSDataListLib.DataCombo DataCombo2 
      Bindings        =   "retbk.frx":0015
      Height          =   315
      Left            =   2160
      TabIndex        =   4
      Top             =   600
      Width           =   2535
      _ExtentX        =   4471
      _ExtentY        =   556
      _Version        =   393216
      Style           =   2
      ListField       =   "书名"
      Text            =   ""
   End
   Begin MSDataListLib.DataCombo DataCombo3 
      Bindings        =   "retbk.frx":002A
      Height          =   315
      Left            =   2040
      TabIndex        =   5
      Top             =   1920
      Width           =   1815
      _ExtentX        =   3201
      _ExtentY        =   556
      _Version        =   393216
      Style           =   2
      ListField       =   "借书日期"
      Text            =   ""
   End
   Begin MSDataListLib.DataCombo DataCombo4 
      Bindings        =   "retbk.frx":003F
      Height          =   315
      Left            =   2040
      TabIndex        =   10
      Top             =   1320
      Width           =   1815
      _ExtentX        =   3201
      _ExtentY        =   556
      _Version        =   393216
      Style           =   2
      ListField       =   "图书编号"
      Text            =   ""
   End
   Begin VB.Label Label4 
      BackColor       =   &H8000000D&
      Caption         =   "图书编号"
      Height          =   255
      Left            =   960
      TabIndex        =   9
      Top             =   1320
      Width           =   1095
   End
   Begin VB.Label Label3 
      BackColor       =   &H8000000D&
      Caption         =   "借书日期"
      Height          =   255
      Left            =   960
      TabIndex        =   3
      Top             =   1920
      Width           =   1095
   End
   Begin VB.Label Label2 
      BackColor       =   &H8000000D&
      Caption         =   "书名"
      Height          =   255
      Left            =   3000
      TabIndex        =   2
      Top             =   360
      Width           =   1095
   End
   Begin VB.Label Label1 
      BackColor       =   &H8000000D&
      Caption         =   "读者编号"
      Height          =   255
      Left            =   720
      TabIndex        =   0
      Top             =   360
      Width           =   1095
   End
End
Attribute VB_Name = "retbk"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim str As String
Dim rs As ADODB.Recordset


Private Sub Command1_Click()
If Trim(DataCombo2.Text) = "" Then
    MsgBox "先从 ‘书名’ 中选择一本书", vbOKOnly + vbExclamation, "信息提示"
    DataCombo3.Text = ""
    DataCombo3.Enabled = False
End If
If Trim(DataCombo3.Text) = "" Then
    MsgBox "先从 ‘借书日期’ 中选择日期", vbOKOnly + vbExclamation, "信息提示"
End If
If Trim(DataCombo4.Text) = "" Then
    MsgBox "先从 ‘图书编号’ 中选择编号", vbOKOnly + vbExclamation, "信息提示"
End If

'str = "select * from 图书借阅表 where 读者编号='" & Trim(DataCombo1.Text) & "'"
'Set rs = exesql(str)
If Trim(DataCombo1.Text) = "" Then
    MsgBox "请输入读者编码.例:0013304", vbOKOnly + vbExclamation, "信息提示"
    DataCombo1.SetFocus
    Exit Sub

End If
str = "select * from 图书借阅表 where datediff(dd,借书日期,getdate())>30 and  读者编号='" & Trim(DataCombo1.Text) & "'"
Set rs = exesql(str)
If rs.RecordCount = 0 Then
    '
    str = "update 图书借阅表 set 还书日期 = getdate() where 图书编号='" & Trim(DataCombo4.Text) & "'"
    exesql (str)
    str = "insert  图书借阅历史表 select * from 图书借阅表  where 还书日期 is not null"
    exesql (str)
    str = "delete 图书借阅表 where 图书编号='" & Trim(DataCombo4.Text) & "'" & " and " & "读者编号='" & Trim(DataCombo1.Text) & "'"
    exesql (str)
    str = "update 图书基本信息表 set 是否在库='1' where 图书编号='" & Trim(DataCombo4.Text) & "'"
    exesql (str)
    Adodc1.Refresh
    MsgBox "成功还书", vbOKOnly + vbExclamation, "信息提示"
    DataCombo1.Text = ""
    DataCombo2.Text = ""
    DataCombo3.Text = ""
    DataCombo4.Text = ""
Else
    'MsgBox rs.RecordCount, vbOKOnly + vbExclamation
    MsgBox "请先交纳罚款!", vbOKOnly + vbExclamation, "信息提示"
End If
    
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub datacombo1_gotfocus()
DataCombo2.Text = ""
DataCombo3.Text = ""
DataCombo4.Text = ""
DataCombo2.Enabled = True
End Sub

Private Sub datacombo1_lostfocus()
If DataCombo1.Text <> "" Then
Adodc2.RecordSource = "select 书名 from 图书借阅表 where 读者编号= '" & Trim(DataCombo1.Text) & "'"
Adodc2.Refresh
End If
DataCombo2.Enabled = True
End Sub
Private Sub datacombo2_gotfocus()
DataCombo3.Text = ""
DataCombo4.Text = ""
If Trim(DataCombo1.Text) = "" Then
    MsgBox "先从 ‘读者编号’ 中选择读者", vbOKOnly + vbExclamation, "信息提示"
    DataCombo2.Enabled = False
End If
DataCombo3.Enabled = True
DataCombo4.Enabled = True
End Sub
Private Sub datacombo2_lostfocus()
If Trim(DataCombo2.Text) <> "" Then
   Adodc3.RecordSource = "select 图书编号,借书日期 from 图书借阅表 where 书名='" & Trim(DataCombo2.Text) & "'"
   Adodc3.Refresh
End If

End Sub
Private Sub datacombo3_gotfocus()
If Trim(DataCombo1.Text) = "" Then
    MsgBox "先从 ‘读者编号’ 中选择读者", vbOKOnly + vbExclamation, "信息提示"
    DataCombo2.Text = ""
    DataCombo2.Enabled = False
    DataCombo3.Text = ""
    DataCombo3.Enabled = False
End If
If Trim(DataCombo2.Text) = "" Then
    MsgBox "先从 ‘书名’ 中选择一本书", vbOKOnly + vbExclamation, "信息提示"
    DataCombo3.Text = ""
    DataCombo3.Enabled = False
End If
End Sub

Private Sub datacombo4_gotfocus()
If Trim(DataCombo1.Text) = "" Then
    MsgBox "先从 ‘读者编号’ 中选择读者", vbOKOnly + vbExclamation, "信息提示"
    DataCombo2.Text = ""
    DataCombo2.Enabled = False
    DataCombo4.Text = ""
    DataCombo4.Enabled = False
End If
If Trim(DataCombo2.Text) = "" Then
    MsgBox "先从 ‘书名’ 中选择一本书", vbOKOnly + vbExclamation, "信息提示"
    DataCombo4.Text = ""
    DataCombo4.Enabled = False
End If
End Sub

⌨️ 快捷键说明

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