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

📄 frmbookmessage.frm

📁 这是图书馆管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   4080
      TabIndex        =   21
      Top             =   240
      Width           =   630
   End
   Begin VB.Label Lblnumbers 
      AutoSize        =   -1  'True
      Caption         =   "数  量"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   4080
      TabIndex        =   14
      Top             =   2040
      Width           =   630
   End
   Begin VB.Label Lblpublish 
      AutoSize        =   -1  'True
      Caption         =   "出版社"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   4080
      TabIndex        =   10
      Top             =   840
      Width           =   630
   End
   Begin VB.Label Lbljointime 
      AutoSize        =   -1  'True
      Caption         =   "入库时间"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   4080
      TabIndex        =   5
      Top             =   1440
      Width           =   840
   End
   Begin VB.Label Lblstate 
      AutoSize        =   -1  'True
      Caption         =   "状    态"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   120
      TabIndex        =   4
      Top             =   2640
      Width           =   825
   End
   Begin VB.Label Lbltypes 
      AutoSize        =   -1  'True
      Caption         =   "类    型"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   120
      TabIndex        =   3
      Top             =   2040
      Width           =   840
   End
   Begin VB.Label Lblauthor 
      AutoSize        =   -1  'True
      Caption         =   "作    者"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   120
      TabIndex        =   2
      Top             =   1440
      Width           =   840
   End
   Begin VB.Label Lblbookname 
      AutoSize        =   -1  'True
      Caption         =   "图书名称"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   120
      TabIndex        =   1
      Top             =   840
      Width           =   840
   End
   Begin VB.Label Lblbookindex 
      AutoSize        =   -1  'True
      Caption         =   "图书编号"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   840
   End
End
Attribute VB_Name = "frmbookmessage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim strInsertSQL As String
Private Sub Cmdclose_Click()
    Unload Me
End Sub
Private Sub Cmdsave_Click()
            '判断输入的数据是否完整
    If ((Trim(Txtbookname.Text) = Empty) _
        Or (Trim(Txtjointime.Text) = Empty) _
        Or (Trim(Txtnumbers.Text) = Empty) _
        Or (Trim(Txtprice.Text) = Empty)) Then
     MsgBox "请输入所有的数据...", vbInformation + vbOKOnly, "图书资料不完整"
            ' 弹出消息框,判断输入的数据是否准确,如果准确向将数据录入数据库
    ElseIf MsgBox("图书名称:" & Trim(Txtbookname.Text) & vbCrLf & _
                      "图书编号:" & Trim(Txtbookindex.Text) & vbCrLf & _
                      "图书价格:" & Trim(Txtprice.Text) & vbCrLf & _
                      "作者:" & Trim(Txtauthor.Text) & vbCrLf & _
                      "出版社:" & Trim(Txtpublish.Text) & vbCrLf & _
                      "状态:" & Cbostate.Text & vbCrLf & _
                      "入库时间:" & Trim(Txtjointime.Text) & vbCrLf & _
                      "数量:" & Trim(Txtnumbers.Text) _
                      , vbOKCancel + vbInformation, "图书资料确认") = vbOK Then
                '向数据库中插入数据
        strInsertSQL = "INSERT INTO BOOKMESSAGE(bookname,price,author,publish,types,states,jointime,numbers)VALUES("
                        
        strInsertSQL = strInsertSQL & "'" & Trim(Txtbookname.Text) & "'"
        strInsertSQL = strInsertSQL & "," & Val(Txtprice.Text)
        strInsertSQL = strInsertSQL & ",'" & Trim(Txtauthor.Text) & "'"
        strInsertSQL = strInsertSQL & ",'" & Trim(Txtpublish.Text) & "'"
        strInsertSQL = strInsertSQL & ",'" & Cbotypes.Text & "'"
        If Cbostate.Text = "在库" Then
            strInsertSQL = strInsertSQL & ",1"
        Else
            strInsertSQL = strInsertSQL & ",0"
        End If
        strInsertSQL = strInsertSQL & ",'" & Trim(Txtjointime.Text) & "'"
        strInsertSQL = strInsertSQL & "," & Val(Txtnumbers.Text) & ")"
                '调用模块中的函数
        If QueryEmpInfo(strInsertSQL) = True Then
            MsgBox "图书资料已保存...", vbInformation + vbOKOnly, "保存成功"
            Txtbookname.Text = ""
            Txtprice.Text = ""
            Txtauthor.Text = ""
            Txtpublish.Text = ""
            Txtjointime.Text = ""
            Txtnumbers.Text = ""
        End If
    End If
    '每次保存数据后,都重新打开一次记录集
    Cmdenter.Enabled = True
    If g_DBRct.State = 1 Then
        g_DBRct.Close
        Set g_DBRct = Nothing
    End If
     '每次保存数据后,将记录集关闭,清空,重新打开
    g_DBRct.Open "bookmessage", g_DBCon, adOpenDynamic, adLockOptimistic
End Sub
Private Sub Form_Load()
    Cbostate.Clear
    Cbostate.AddItem "在库"  '窗体加载时列表框中自动生成内容,并有默认值
    Cbostate.AddItem "借出"
    Cbostate.ListIndex = 0
    Cbotypes.Clear
    Cbotypes.AddItem "报纸"
    Cbotypes.AddItem "图书"
    Cbotypes.AddItem "杂志"
    Cbotypes.ListIndex = 0
        '调用模块中的函数,在窗体加载时显示最后一次登记的信息
    QueryEmpInfo "BookMessage"
    g_DBRct.MoveLast
    Call ShowData
End Sub
Private Sub Cmdnext_Click()
    '下一个的按纽单击事件
    If g_DBRct.BOF = False And g_DBRct.EOF = False Then
        g_DBRct.MoveNext
        If g_DBRct.EOF = True Then
            g_DBRct.MoveLast
        End If
        Call ShowData
    End If
End Sub
Private Sub Cmdprev_Click()
    '上一个的按纽单击事件
    If g_DBRct.BOF = False And g_DBRct.EOF = False Then
        g_DBRct.MovePrevious
        If g_DBRct.BOF = True Then
            g_DBRct.MoveFirst
        End If
        Call ShowData
    End If
End Sub
Private Sub Cmdfirst_Click()
    '第一个的按纽单击事件
    If g_DBRct.BOF = False And g_DBRct.EOF = False Then
        g_DBRct.MoveFirst
        Call ShowData
    End If
End Sub
Private Sub Cmdlast_Click()
    '最后一个的按纽单击事件
    If g_DBRct.BOF = False And g_DBRct.EOF = False Then
        g_DBRct.MoveLast
        Call ShowData
    End If
End Sub
Private Sub Cmdenter_Click()
        '登记时,将记录集的指针移到最后一位,自动生成新的图书编号,清空信息
    g_DBRct.MoveLast
    Dim x As Integer
    x = g_DBRct!bookindex
    Txtbookindex.Text = x + 1
    If Val(Txtbookindex.Text) = x + 1 Then
        Cmdenter.Enabled = False
    End If
    Cmdenter.Enabled = False
    Txtbookname.Text = Empty
    Txtauthor.Text = Empty
    Txtjointime.Text = Date  '调用系统时间
    Txtnumbers.Text = Empty
    Txtprice.Text = Empty
    Txtpublish.Text = Empty
End Sub
Private Sub Cmdremove_Click()
    If g_DBRct.EOF And g_DBRct.BOF Then
        MsgBox "读者资料库为空!"
        Cmdremove.Enabled = False
    ElseIf MsgBox("确实要删除该图书的信息吗?", vbQuestion + vbYesNo, "删除信息") = vbYes Then
        g_DBRct.Delete
        Cmdremove.Enabled = True
        Call Cmdnext_Click
    End If
End Sub
Private Sub ShowData()
    Txtbookindex.Text = g_DBRct!bookindex  '打开窗体时,显示最后登记的图书的资料
    Txtbookname.Text = g_DBRct!bookname
    Txtprice.Text = g_DBRct!price
    Txtauthor.Text = g_DBRct!author
    Txtpublish.Text = g_DBRct!publish
    Cbotypes.Text = g_DBRct!types
    If g_DBRct!states = True Then
        Cbostate.Text = "在库"
    Else
        Cbostate.Text = "借出"
    End If
    Txtjointime.Text = g_DBRct!jointime
    Txtnumbers.Text = g_DBRct!numbers
End Sub

⌨️ 快捷键说明

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