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

📄 edbook1.frm

📁 一个用VB编写的小型图书管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Width           =   1095
      End
      Begin VB.Label Label6 
         Caption         =   "定  价"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   600
         TabIndex        =   6
         Top             =   2760
         Width           =   615
      End
      Begin VB.Label Label5 
         Caption         =   "出版社"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   600
         TabIndex        =   5
         Top             =   2280
         Width           =   615
      End
      Begin VB.Label Label4 
         Caption         =   "作  者*"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   480
         TabIndex        =   4
         Top             =   1800
         Width           =   735
      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            =   480
         TabIndex        =   3
         Top             =   1320
         Width           =   735
      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            =   600
         TabIndex        =   2
         Top             =   840
         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            =   360
         TabIndex        =   1
         Top             =   360
         Width           =   1095
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   1080
      Top             =   0
      Visible         =   0   'False
      Width           =   2055
      _ExtentX        =   3625
      _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 press"
      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 = "edbook1"
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()
  tna = "press"
  cap = "出版社"
  edrec.Show vbModal
End Sub
Private Sub Command2_Click()
  If Trim(Text1(0).Text) = "" Or Trim(Text1(2).Text) = "" Or Trim(Text1(3).Text) = "" Or Trim(Text1(5).Text) = "" Then
   MsgBox "加*数据项不能为空,请重新填写", vbOKOnly, "信息提示"
   Exit Sub
  End If
  If flag = 1 Then
    sqltxt = "select * from book 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
   edbook.Adodc1.Recordset.AddNew
   edbook.Adodc1.Recordset.Fields("图书编号") = Trim(Text1(0).Text)
   edbook.Adodc1.Recordset.Fields("分类号") = Trim(Text1(1).Text)
   edbook.Adodc1.Recordset.Fields("书名") = Trim(Text1(2).Text)
   edbook.Adodc1.Recordset.Fields("作者") = Trim(Text1(3).Text)
   edbook.Adodc1.Recordset.Fields("出版社") = Trim(DataCombo1.Text)
   edbook.Adodc1.Recordset.Fields("定价") = Val(Trim(Text1(4).Text))
   edbook.Adodc1.Recordset.Fields("入库日期") = Format(Trim(Text1(5).Text), "yy-mm-dd")
   edbook.Adodc1.Recordset.Fields("借否") = "否"
   edbook.Adodc1.Recordset.Update
   recs = recs + 1
 Else
   edbook.Adodc1.Recordset.Fields("图书编号") = Trim(Text1(0).Text)
   edbook.Adodc1.Recordset.Fields("分类号") = Trim(Text1(1).Text)
   edbook.Adodc1.Recordset.Fields("书名") = Trim(Text1(2).Text)
   edbook.Adodc1.Recordset.Fields("作者") = Trim(Text1(3).Text)
   edbook.Adodc1.Recordset.Fields("出版社") = Trim(DataCombo1.Text)
   edbook.Adodc1.Recordset.Fields("定价") = Val(Trim(Text1(4).Text))
   edbook.Adodc1.Recordset.Fields("入库日期") = Format(Trim(Text1(5).Text), "yyyy-mm-dd")
   edbook.Adodc1.Recordset.Fields("借否") = "否"
    End If
 Unload Me
End Sub
Private Sub Command3_Click()
  Unload Me
End Sub
Private Sub DataCombo1_KeyPress(KeyAscii As Integer)
  Call endata(KeyAscii)
End Sub

Private Sub Form_Activate()
  Adodc1.Refresh
End Sub
Private Sub Form_Load()
 If flag = 2 Then
   Text1(0).Text = edbook.Adodc1.Recordset.Fields("图书编号") & ""
   Text1(1).Text = edbook.Adodc1.Recordset.Fields("分类号") & ""
   Text1(2).Text = edbook.Adodc1.Recordset.Fields("书名") & ""
   Text1(3).Text = edbook.Adodc1.Recordset.Fields("作者") & ""
   DataCombo1.Text = edbook.Adodc1.Recordset.Fields("出版社") & ""
   Text1(4).Text = edbook.Adodc1.Recordset.Fields("定价") & ""
   Text1(5).Text = edbook.Adodc1.Recordset.Fields("入库日期") & ""
   Text1(0).Enabled = False
 Else
   Text1(5).Text = Date
 End If
End Sub

⌨️ 快捷键说明

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