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

📄 borrow.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 borrow 
   BackColor       =   &H8000000D&
   Caption         =   "读者借书窗口"
   ClientHeight    =   3195
   ClientLeft      =   5700
   ClientTop       =   1410
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   Begin MSAdodcLib.Adodc Adodc0 
      Height          =   330
      Left            =   -480
      Top             =   0
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   2
      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    =   "图书借阅表"
      Caption         =   "Adodc4"
      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 back 
      Caption         =   "返回"
      Height          =   495
      Left            =   3840
      TabIndex        =   10
      Top             =   2640
      Width           =   735
   End
   Begin VB.CommandButton cancel 
      Caption         =   "取消"
      Height          =   375
      Left            =   1680
      TabIndex        =   9
      Top             =   2640
      Width           =   975
   End
   Begin VB.CommandButton ok 
      Caption         =   "确定"
      Height          =   375
      Left            =   360
      TabIndex        =   8
      Top             =   2640
      Width           =   975
   End
   Begin VB.TextBox uid 
      Height          =   375
      Left            =   1320
      TabIndex        =   7
      Top             =   1920
      Width           =   1815
   End
   Begin MSAdodcLib.Adodc Adodc3 
      Height          =   330
      Left            =   -480
      Top             =   2160
      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 图书基本信息表"
      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 MSDataListLib.DataCombo DataCombo3 
      Bindings        =   "borrow.frx":0000
      Height          =   315
      Left            =   1320
      TabIndex        =   5
      Top             =   1320
      Width           =   1815
      _ExtentX        =   3201
      _ExtentY        =   556
      _Version        =   393216
      Style           =   2
      ListField       =   "图书编号"
      Text            =   ""
   End
   Begin MSDataListLib.DataCombo DataCombo2 
      Bindings        =   "borrow.frx":0015
      Height          =   315
      Left            =   2040
      TabIndex        =   3
      Top             =   600
      Width           =   2535
      _ExtentX        =   4471
      _ExtentY        =   556
      _Version        =   393216
      Style           =   2
      ListField       =   "书名"
      Text            =   ""
   End
   Begin MSAdodcLib.Adodc Adodc2 
      Height          =   330
      Left            =   -480
      Top             =   1680
      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 图书基本信息表"
      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 MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   -480
      Top             =   1200
      Visible         =   0   'False
      Width           =   1215
      _ExtentX        =   2143
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   2
      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    =   "图书种类表"
      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        =   "borrow.frx":002A
      DataField       =   "图书种类"
      DataSource      =   "Adodc1"
      Height          =   315
      Left            =   120
      TabIndex        =   1
      Top             =   600
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   556
      _Version        =   393216
      Style           =   2
      ListField       =   "图书种类"
      Text            =   ""
   End
   Begin VB.Label Label4 
      BackColor       =   &H8000000D&
      Caption         =   "读者编号"
      Height          =   375
      Left            =   480
      TabIndex        =   6
      Top             =   1920
      Width           =   1215
   End
   Begin VB.Label Label3 
      BackColor       =   &H8000000D&
      Caption         =   "图书编号"
      Height          =   375
      Left            =   480
      TabIndex        =   4
      Top             =   1320
      Width           =   1215
   End
   Begin VB.Label Label2 
      BackColor       =   &H8000000D&
      Caption         =   "书名"
      Height          =   375
      Left            =   3120
      TabIndex        =   2
      Top             =   360
      Width           =   1215
   End
   Begin VB.Label Label1 
      BackColor       =   &H8000000D&
      Caption         =   "图书种类"
      Height          =   375
      Left            =   720
      TabIndex        =   0
      Top             =   360
      Width           =   1215
   End
End
Attribute VB_Name = "borrow"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As ADODB.Recordset
Dim str As String


Private Sub Form_Activate()

Adodc0.Refresh

End Sub


Private Sub back_Click()
Unload Me
End Sub

Private Sub cancel_Click()
Unload Me
End Sub

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


Private Sub datacombo1_lostfocus()
If DataCombo1.Text <> "" Then
    Adodc2.RecordSource = "select 书名 from 图书基本信息表 where 图书种类 ='" & LTrim(DataCombo1.Text) & "'" & " and 是否在库='1'"
    Adodc2.Refresh
End If
DataCombo2.Enabled = True
End Sub
Private Sub datacombo2_gotfocus()
DataCombo3.Text = ""
If Trim(DataCombo1.Text) = "" Then
    MsgBox "先从 ‘图书种类’ 中选择一个种类", vbOKOnly + vbExclamation, "信息提示"
    DataCombo2.Enabled = False
End If
DataCombo3.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 ok_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

str = "select * from 查阅者基本信息表 where 读者编号='" & Trim(uid.Text) & "'"
Set rs = exesql(str)
If Trim(uid.Text) = "" Then
    MsgBox "请输入读者编码.例:0013304", vbOKOnly + vbExclamation, "信息提示"
    uid.SetFocus
    Exit Sub
ElseIf rs.RecordCount = 0 Then
    MsgBox "无此用户,请重试!", vbOKOnly + vbExclamation, "信息提示"
    uid.Text = ""
    uid.SetFocus
    Exit Sub
End If

'str = "borrow '" & Trim(DataCombo3.Text) & "'"
'Set rs = exesql(str)
str = "select * from 图书借阅表 where getdate()-借书日期>30 and 读者编号 = '" & Trim(uid.Text) & "'"
Set rs = exesql(str)
If rs.RecordCount <> 0 Then
    MsgBox "请先还过期未还书,不能借书!", vbOKOnly + vbExclamation, "信息提示"
Else

    borrow.Adodc0.Recordset.AddNew
    borrow.Adodc0.Recordset.Fields("图书编号") = Trim(DataCombo3.Text)
    borrow.Adodc0.Recordset.Fields("书名") = Trim(DataCombo2.Text)
    borrow.Adodc0.Recordset.Fields("读者编号") = Trim(uid.Text)
    borrow.Adodc0.Recordset.Fields("借书日期") = Now
    borrow.Adodc0.Recordset.Update
    borrow.Adodc0.Refresh
    str = "update 图书基本信息表 set 是否在库 ='0' where 图书编号='" & Trim(DataCombo3.Text) & "'"
    exesql (str)
    MsgBox "借阅成功!", vbOKOnly + vbExclamation, "信息提示"
    DataCombo3.Text = ""
    DataCombo2.Text = ""
    DataCombo1.Text = ""
    uid.Text = ""
End If

End Sub

⌨️ 快捷键说明

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