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

📄 edreader1.frm

📁 一个用VB编写的小型图书管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            Caption         =   "女"
            Height          =   255
            Left            =   720
            TabIndex        =   5
            Top             =   240
            Width           =   495
         End
         Begin VB.OptionButton Opt1 
            Caption         =   "男"
            Height          =   255
            Left            =   120
            TabIndex        =   4
            Top             =   240
            Width           =   495
         End
      End
      Begin VB.Label Label8 
         Caption         =   "<-日期格式:yy-mm-dd"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2880
         TabIndex        =   13
         Top             =   3120
         Width           =   2295
      End
      Begin VB.Label Label7 
         Caption         =   "登记日期"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   360
         TabIndex        =   12
         Top             =   3120
         Width           =   975
      End
      Begin VB.Label Label3 
         Caption         =   "学 院"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2760
         TabIndex        =   6
         Top             =   600
         Width           =   495
      End
      Begin VB.Label Label2 
         Caption         =   "姓 名*"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2760
         TabIndex        =   2
         Top             =   240
         Width           =   615
      End
      Begin VB.Label Label1 
         Caption         =   "借书证号"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   1
         Top             =   240
         Width           =   855
      End
   End
   Begin MSAdodcLib.Adodc Adodc2 
      Height          =   330
      Left            =   5160
      Top             =   0
      Visible         =   0   'False
      Width           =   1455
      _ExtentX        =   2566
      _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=Microsoft.Jet.OLEDB.4.0;Data Source=Lib.mdb;Persist Security Info=False;"
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Lib.mdb;Persist Security Info=False;"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from depart"
      Caption         =   "Adodc2"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   3120
      Top             =   0
      Visible         =   0   'False
      Width           =   1695
      _ExtentX        =   2990
      _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=Microsoft.Jet.OLEDB.4.0;Data Source=Lib.mdb;Persist Security Info=False;"
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Lib.mdb;Persist Security Info=False;"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from rlevel"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
End
Attribute VB_Name = "edreader1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As ADODB.Recordset

Private Sub Command1_Click()
edlev.Show vbModal
End Sub

Private Sub Command2_Click()
  If Trim(Text1(0).Text) = "" Or Trim(Text1(1).Text) = "" Or Trim(Text1(5).Text) = "" Or Trim(DataCombo1.Text) = "" Then
    MsgBox "加*数据项不能为空,请重新设置", vbOKOnly, "信息提示"
    Exit Sub
  End If
  If flag = 1 Then
    sqltxt = "select * from reader where 借书证号='" + Trim(Text1(0).Text) + "'"
    Set rs = exesql(sqltxt)
    If rs.RecordCount <> 0 Then
      MsgBox "存在相同的借书证号", vbOKOnly, "信息提示"
      Text1(0).SetFocus
      rs.Close
      Exit Sub
    Else
      rs.Close
    End If
    edreader.Adodc1.Recordset.AddNew
    edreader.Adodc1.Recordset.Fields("借书证号") = Trim(Text1(0).Text)
    edreader.Adodc1.Recordset.Fields("姓名") = Trim(Text1(1).Text)
    If Opt1.Value = True Then
      edreader.Adodc1.Recordset.Fields("性别") = "男"
    Else
      edreader.Adodc1.Recordset.Fields("性别") = "女"
    End If
    edreader.Adodc1.Recordset.Fields("学院") = Trim(DataCombo2.Text)
    edreader.Adodc1.Recordset.Fields("级别") = Trim(DataCombo1.Text)
    edreader.Adodc1.Recordset.Fields("过期罚款") = Trim(Text1(2).Text)
    edreader.Adodc1.Recordset.Fields("借书总数") = Val(Trim(Text1(3).Text))
    edreader.Adodc1.Recordset.Fields("借书天数") = Val(Trim(Text1(4).Text))
    edreader.Adodc1.Recordset.Fields("已借书数") = 0
    edreader.Adodc1.Recordset.Fields("登记日期") = Format(Trim(Text1(5).Text), "yyyy-mm-dd")
    edreader.Adodc1.Recordset.Update
    recs = recs + 1
  Else
    edreader.Adodc1.Recordset.Fields("借书证号") = Trim(Text1(0).Text)
    edreader.Adodc1.Recordset.Fields("姓名") = Trim(Text1(1).Text)
    If Opt1.Value = True Then
      edreader.Adodc1.Recordset.Fields("性别") = "男"
    Else
      edreader.Adodc1.Recordset.Fields("性别") = "女"
    End If
    edreader.Adodc1.Recordset.Fields("学院") = Trim(DataCombo2.Text)
    edreader.Adodc1.Recordset.Fields("级别") = Trim(DataCombo1.Text)
    edreader.Adodc1.Recordset.Fields("过期罚款") = Trim(Text1(2).Text)
    edreader.Adodc1.Recordset.Fields("借书总数") = Val(Trim(Text1(3).Text))
    edreader.Adodc1.Recordset.Fields("借书天数") = Val(Trim(Text1(4).Text))
    edreader.Adodc1.Recordset.Fields("登记日期") = Format(Trim(Text1(5).Text), "yyyy-mm-dd")
    edreader.Adodc1.Recordset.Update
  End If
   Unload Me
End Sub

Private Sub Command3_Click()
 Unload Me
End Sub

Private Sub Command4_Click()
  tna = "depart"
  cap = "单 位"
  edrec.Show vbModal
End Sub

Private Sub DataCombo1_LostFocus()
  If Adodc1.Recordset.RecordCount > 0 Then
    If Trim(DataCombo1.Text) <> "" Then
      Adodc1.Recordset.MoveFirst
      Adodc1.Recordset.Find ("级别='" & Trim(DataCombo1.Text) & "'")
      Text1(2).Text = Adodc1.Recordset.Fields("过期罚款")
      Text1(3).Text = Adodc1.Recordset.Fields("借书总数")
      Text1(4).Text = Adodc1.Recordset.Fields("借书天数")
    End If
  Else
    MsgBox "没有任何级别项可选,请设置", vbOKOnly, "信息提示"
  End If
End Sub

Private Sub Form_Activate()
  Adodc1.Refresh
  Adodc2.Refresh
  DataCombo1.Refresh
  DataCombo2.Refresh
End Sub

Private Sub Form_Load()
  If flag = 2 Then
    Text1(0).Text = edreader.Adodc1.Recordset.Fields("借书证号") & ""
    Text1(1).Text = edreader.Adodc1.Recordset.Fields("姓名") & ""
    If edreader.Adodc1.Recordset.Fields("性别") = "男" Then
      Opt1.Value = True
    Else
      Opt2.Value = True
    End If
    DataCombo2.Text = edreader.Adodc1.Recordset.Fields("学院") & ""
    DataCombo1.Text = edreader.Adodc1.Recordset.Fields("级别") & ""
    Text1(2).Text = edreader.Adodc1.Recordset.Fields("过期罚款") & ""
    Text1(3).Text = edreader.Adodc1.Recordset.Fields("借书总数") & ""
    Text1(4).Text = edreader.Adodc1.Recordset.Fields("借书天数") & ""
    Text1(5).Text = edreader.Adodc1.Recordset.Fields("登记日期") & ""
    Text1(0).Enabled = False
  Else
    Text1(5).Text = Data
  End If
End Sub

⌨️ 快捷键说明

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