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

📄 form4.frm

📁 实现图书信息管理
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form4 
   Caption         =   "信息查询"
   ClientHeight    =   3780
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4425
   LinkTopic       =   "Form4"
   MaxButton       =   0   'False
   ScaleHeight     =   3780
   ScaleWidth      =   4425
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame2 
      Caption         =   "请输入所要找的图书的ISBN"
      Height          =   1335
      Left            =   240
      TabIndex        =   5
      Top             =   1560
      Width           =   3975
      Begin VB.ComboBox Combo2 
         Height          =   300
         Left            =   1320
         TabIndex        =   9
         Top             =   360
         Width           =   1815
      End
      Begin VB.Label Label3 
         Caption         =   "*(填入的数据大小必须是1-16个字符)"
         ForeColor       =   &H000000FF&
         Height          =   255
         Left            =   240
         TabIndex        =   7
         Top             =   840
         Width           =   3255
      End
      Begin VB.Label Label2 
         Caption         =   "ISBN:"
         Height          =   255
         Left            =   120
         TabIndex        =   6
         Top             =   360
         Width           =   735
      End
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   375
      Left            =   2040
      TabIndex        =   3
      Top             =   3240
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "GO"
      Height          =   375
      Left            =   480
      TabIndex        =   2
      Top             =   3240
      Width           =   975
   End
   Begin VB.Frame Frame1 
      Caption         =   "请输入所要找的读者的借书证号"
      Height          =   1095
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   3975
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   1320
         TabIndex        =   8
         Top             =   240
         Width           =   1815
      End
      Begin VB.Label Label9 
         Caption         =   "*(请填入八位数字)"
         ForeColor       =   &H000000FF&
         Height          =   255
         Left            =   1320
         TabIndex        =   4
         Top             =   720
         Width           =   1695
      End
      Begin VB.Label Label1 
         Caption         =   "借书证号:"
         Height          =   255
         Left            =   120
         TabIndex        =   1
         Top             =   360
         Width           =   975
      End
   End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
Dim response
Dim i As Integer
Dim s As String

If del = 1 Then
    If Len(Trim(Combo1.Text)) <> 8 Then
        response = MsgBox("请按照要求输入", vbOKOnly + vbExclamation, "注意")
    Else
        cmd.CommandText = "select * from XS where 借书证号=" & "'" & Trim(Combo1.Text) & "'"
        Set rs = cmd.Execute
        If rs.EOF = True Then
            response = MsgBox("此读者不存在", vbOKOnly + vbExclamation, "注意")
        Else
            Unload Me
            Form3.Show
            Form3.Text1.Text = rs.Fields("借书证号")
'            Dim tempfile As String
'            Call getfromDB(tempfile, Trim(Combo1.Text))
'            Form3.Image1.Picture = LoadPicture(tempfile)
        End If
    End If
End If

If del = 2 Then
    If Len(Trim(Combo2.Text)) > 16 Or Combo2.Text = "" Then
        response = MsgBox("请按照要求输入", vbOKOnly + vbExclamation, "注意")
    Else
        Set cmd.ActiveConnection = cnn
        cmd.CommandText = "select * from BOOK where ISBN=" & "'" & Trim(Combo2.Text) & "'"
        Set rs = cmd.Execute
        If rs.EOF = True Then
            response = MsgBox("此图书不存在", vbOKOnly + vbExclamation, "注意")
        Else
            Unload Me
            Form6.Show
            Form6.Text1.Text = rs.Fields("ISBN")
            Form6.Text2.Text = rs.Fields("书名")
            Form6.Text3.Text = rs.Fields("作者")
            Form6.Combo1.Text = rs.Fields("出版社")
            Form6.Text4.Text = rs.Fields("价格")
            Form6.Text5.Text = rs.Fields("复本量")
            Form6.Text6.Text = rs.Fields("库存量")
        End If
    End If
End If
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
Set cmd.ActiveConnection = cnn
If del = 1 Then
   Me.Frame2.Enabled = False
   cmd.CommandText = "select 借书证号 from XS"
   Set rs = cmd.Execute
   rs.MoveFirst
   Do While rs.EOF = False
      Combo1.AddItem rs.Fields(0)
      rs.MoveNext
   Loop
End If
If del = 2 Then
   Me.Frame1.Enabled = False
   cmd.CommandText = "select ISBN from BOOK"
   Set rs = cmd.Execute
   rs.MoveFirst
   Do While rs.EOF = False
      Combo2.AddItem rs.Fields(0)
      rs.MoveNext
   Loop

End If
End Sub

⌨️ 快捷键说明

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