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

📄 frmbanka.frm

📁 图书管理系统,图书信息,添加学生信息,借书与归还记载,借书卡办理,查询图书信息
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      TabIndex        =   4
      Top             =   600
      Width           =   1095
   End
   Begin MSComCtl2.DTPicker DTPicker2 
      Height          =   375
      Left            =   4440
      TabIndex        =   3
      Top             =   1200
      Width           =   1455
      _ExtentX        =   2566
      _ExtentY        =   661
      _Version        =   393216
      Enabled         =   0   'False
      Format          =   70451201
      CurrentDate     =   29543
   End
   Begin MSComCtl2.DTPicker DTPicker1 
      Height          =   375
      Left            =   1440
      TabIndex        =   2
      Top             =   1200
      Width           =   1455
      _ExtentX        =   2566
      _ExtentY        =   661
      _Version        =   393216
      Enabled         =   0   'False
      Format          =   70451201
      CurrentDate     =   29543
   End
   Begin VB.TextBox Text2 
      Height          =   270
      Left            =   4200
      TabIndex        =   1
      Top             =   360
      Width           =   1455
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H8000000E&
      Height          =   270
      Left            =   1320
      TabIndex        =   0
      Top             =   360
      Width           =   1455
   End
   Begin VB.Label Label4 
      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
      Index           =   1
      Left            =   6000
      TabIndex        =   22
      Top             =   1320
      Width           =   840
   End
   Begin VB.Label Label5 
      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            =   3360
      TabIndex        =   9
      Top             =   1320
      Width           =   840
   End
   Begin VB.Label Label4 
      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
      Index           =   0
      Left            =   6120
      TabIndex        =   8
      Top             =   240
      Width           =   1470
   End
   Begin VB.Label Label3 
      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            =   360
      TabIndex        =   7
      Top             =   1320
      Width           =   840
   End
   Begin VB.Label Label2 
      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            =   3360
      TabIndex        =   6
      Top             =   480
      Width           =   420
   End
   Begin VB.Label Label1 
      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            =   360
      TabIndex        =   5
      Top             =   360
      Width           =   525
   End
End
Attribute VB_Name = "frmbanka"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer         '用于FOR循环中的变量
Dim StrNum As Long       '定义一个用于保存窗口信息的变量

Private Sub Command1_Click()
frmjieshu.Text1.Text = Text2.Text
frmhuanshu.Text1.Text = Text2.Text
Unload Me
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Unload(Cancel As Integer)
frmstudent.Frame1.Visible = False

End Sub

Private Sub Text1_Click()

frmstudent.Frame1.Visible = True '''''**在此窗体UNLOAD ME 时,将其改回去*
frmstudent.Show 1

End Sub

Private Sub Cmd_Add_Click()
On Error Resume Next

    Adodc1.RecordSource = "select * from 图书卡 order by 学号"
        Adodc1.Refresh
          
   Text1.SetFocus
   cmd_save.Enabled = True
   cmd_del.Enabled = False
   cmd_edit.Enabled = False
End Sub

Private Sub Cmd_del_Click()
If Text1.Text = "" Then
   MsgBox "请选择您要删除的记录!", 48, "提示"
   Exit Sub
End If
    If Adodc1.Recordset.EOF = False Then
          c = MsgBox("您确认要删除该记录吗?", 17, "删除提示信息")
                 If c = vbOK Then
                    If Text1.Text = "" Then
                        MsgBox "请选择您要删除的记录!", 48, "提示"
                    Else
                        Adodc1.Recordset.Delete     '删除所选中的记录信息
                        Adodc1.Refresh
                         Text1.Text = ""
                       Text2.Text = ""
                        cmd_del.Enabled = False
                    Call TRefresh                 '调用数据刷新过程
                    End If
                 End If
     Else
               MsgBox "当前数据库中已经没有可删除的记录", 64, "提示信息"
     End If
End Sub

Private Sub Cmd_edit_Click()

   If Text1.Text = "" Then
      MsgBox "请选择需要改动的记录信息!", 48, "信息提示"
   Else
        c = MsgBox("确认要修改该记录吗?", 33, "修改信息提示")
           If c = vbOK Then                                   '如果确认修改的话进行修改操作
               If Text1.Text = "" Then
                  MsgBox "书号不能为空值!", 48, "修改信息提示"
               Else
                            Call main     '调用公共模块中的连接数据库函数
                            Set adoRs = adoCon.Execute("UPDATE 图书卡 SET 学号='" + Text1.Text + "',卡号='" + Text2.Text + "',最大允许借出数='" + Combo1.Text + "' where 学号='" + Text1.Text + "'")
                            MsgBox "信息修改成功", 64, "修改信息提示"
                            cmd_edit.Enabled = False
                            adoCon.Close                  '关闭数据连接
                            Call TRefresh                 '调用数据刷新过程
                End If
            Else
            End If
   End If
End Sub
Private Sub cmd_exit_Click()
Unload Me
End Sub

Private Sub Cmd_save_Click()
Text3.Text = Date
Text4.Text = Date + 1360

        c = MsgBox("您确认要保存该信息吗?", 33, "保存信息提示")
          If c = vbOK Then
               If Text1.Text = "" Then
                  MsgBox "信息不能为空值!", 48, "保存信息提示"
               Else
                      Call main                                            '调用公共模块中的连接数据库函数
                      '保存
                      Set adoRs = adoCon.Execute("insert into 图书卡 values('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Combo1.Text & "','" & Text5.Text & "')")
                         MsgBox "信息保存成功", 64, "保存信息提示"
                         cmd_save.Enabled = False
                      adoCon.Close
                      Call TRefresh                               '调用数据刷新过程
                End If
          Else
          End If
          cmd_save.Enabled = False
End Sub


Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
  Call JionBack                                        '调用数据信息反绑定过程
  cmd_del.Enabled = True
  cmd_edit.Enabled = True
  cmd_save.Enabled = False
End Sub

Private Sub Form_Load()
   Text1.Text = ""  '防止frmstudent带来作废数据
   Me.Left = (Screen.Width - Me.Width) / 2
   Me.Top = (Screen.Height - Me.Height) / 2
   Combo1.ListIndex = 0
End Sub
' 自定义数据信息反绑定的过程
Private Sub JionBack()
On Error Resume Next     '执行错误处理
Dim SLen As Integer
  If Adodc1.Recordset.RecordCount > 0 Then
Text1.Text = Trim(Adodc1.Recordset(0))
Text2.Text = Trim(Adodc1.Recordset(1))
DTPicker1.Value = Trim(Adodc1.Recordset(2))
DTPicker2.Value = Trim(Adodc1.Recordset(3))
Combo1.Text = Trim(Adodc1.Recordset(4))
Text5.Text = Trim(Adodc1.Recordset(5))
     '将数据信息反绑定到文本框当中
    
  End If
End Sub
' 自定义数据刷新的过程
Private Sub TRefresh()
    Adodc1.RecordSource = "select * from 图书卡 order by 学号"
    Adodc1.Refresh
End Sub


⌨️ 快捷键说明

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