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

📄 frmedbook1.frm

📁 这是一个比较实用的图书馆管理系统的源代码。
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form frmEdbook1 
   Caption         =   "编辑图书记录"
   ClientHeight    =   5370
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5820
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5370
   ScaleWidth      =   5820
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton Comm2 
      Caption         =   "取消"
      Height          =   495
      Left            =   2520
      TabIndex        =   18
      Top             =   4560
      Width           =   1095
   End
   Begin VB.CommandButton Comm1 
      Caption         =   "确定"
      Height          =   495
      Left            =   840
      TabIndex        =   17
      Top             =   4560
      Width           =   1095
   End
   Begin VB.Frame Frame1 
      Caption         =   "图书记录"
      Height          =   3975
      Left            =   360
      TabIndex        =   0
      Top             =   480
      Width           =   5055
      Begin VB.TextBox Text1 
         Height          =   285
         Index           =   5
         Left            =   1200
         TabIndex        =   15
         Top             =   3120
         Width           =   1575
      End
      Begin VB.TextBox Text1 
         Height          =   285
         Index           =   4
         Left            =   1200
         TabIndex        =   14
         Top             =   2640
         Width           =   1575
      End
      Begin VB.CommandButton selcom 
         Caption         =   "..........."
         Height          =   375
         Left            =   3000
         TabIndex        =   13
         Top             =   2160
         Width           =   855
      End
      Begin MSDataListLib.DataCombo DataCombo1 
         Bindings        =   "frmEdbook1.frx":0000
         Height          =   315
         Left            =   1200
         TabIndex        =   12
         Top             =   2160
         Width           =   1695
         _ExtentX        =   2990
         _ExtentY        =   556
         _Version        =   393216
         ListField       =   ""
         Text            =   ""
      End
      Begin VB.TextBox Text1 
         Height          =   285
         Index           =   3
         Left            =   1200
         TabIndex        =   11
         Top             =   1680
         Width           =   1575
      End
      Begin VB.TextBox Text1 
         Height          =   285
         Index           =   2
         Left            =   1200
         TabIndex        =   10
         Top             =   1200
         Width           =   1575
      End
      Begin VB.TextBox Text1 
         Height          =   285
         Index           =   1
         Left            =   1200
         TabIndex        =   9
         Top             =   720
         Width           =   1575
      End
      Begin VB.TextBox Text1 
         Height          =   285
         Index           =   0
         Left            =   1200
         TabIndex        =   8
         Top             =   240
         Width           =   1575
      End
      Begin VB.Label Label2 
         Caption         =   "<-日期格式:yy-mm-dd"
         Height          =   375
         Left            =   3000
         TabIndex        =   16
         Top             =   3120
         Width           =   1815
      End
      Begin VB.Label Label1 
         Caption         =   "入库日期*"
         Height          =   255
         Index           =   6
         Left            =   240
         TabIndex        =   7
         Top             =   3120
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "定 价"
         Height          =   255
         Index           =   5
         Left            =   360
         TabIndex        =   6
         Top             =   2640
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   " 出版社"
         Height          =   255
         Index           =   4
         Left            =   240
         TabIndex        =   5
         Top             =   2160
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   " 作者*"
         Height          =   255
         Index           =   3
         Left            =   240
         TabIndex        =   4
         Top             =   1680
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   " 书名*"
         Height          =   255
         Index           =   2
         Left            =   240
         TabIndex        =   3
         Top             =   1200
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   " 分类号"
         Height          =   255
         Index           =   1
         Left            =   240
         TabIndex        =   2
         Top             =   720
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "图书编号*"
         Height          =   255
         Index           =   0
         Left            =   240
         TabIndex        =   1
         Top             =   240
         Width           =   855
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   360
      Top             =   0
      Width           =   5175
      _ExtentX        =   9128
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   3
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "DSN=Library"
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   "Library"
      OtherAttributes =   ""
      UserName        =   "adminlibrary"
      Password        =   ""
      RecordSource    =   "select * from press"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
End
Attribute VB_Name = "frmEdbook1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As ADODB.Recordset

Private Sub Comm1_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) + "'" '对book记录进行判断
      Set rs = exesql(sqltxt)
      If rs.RecordCount <> 0 Then
         MsgBox "存在相同的图书编号", vbOKOnly, "信息提示"
         Text1(0).SetFocus
         rs.Close
         Exit Sub
      Else
        rs.Close
      End If
      
      frmEdbook.Adodc1.Recordset.AddNew
      frmEdbook.Adodc1.Recordset.Fields("图书编号") = Trim(Text1(0).Text)
      frmEdbook.Adodc1.Recordset.Fields("分类号") = Trim(Text1(1).Text)
      frmEdbook.Adodc1.Recordset.Fields("书名") = Trim(Text1(2).Text)
      frmEdbook.Adodc1.Recordset.Fields("作者") = Trim(Text1(3).Text)
      frmEdbook.Adodc1.Recordset.Fields("出版社") = Trim(DataCombo1.Text)
      frmEdbook.Adodc1.Recordset.Fields("定价") = Val(Trim(Text1(4).Text))
      frmEdbook.Adodc1.Recordset.Fields("入库日期") = Format(Trim(Text1(5).Text), "yyyy-mm-dd")
      frmEdbook.Adodc1.Recordset.Fields("借否") = "否"
      frmEdbook.Adodc1.Recordset.Update
      recs = recs + 1
  Else '修改操作
      frmEdbook.Adodc1.Recordset.Fields("图书编号") = Trim(Text1(0).Text)
      frmEdbook.Adodc1.Recordset.Fields("分类号") = Trim(Text1(1).Text)
      frmEdbook.Adodc1.Recordset.Fields("书名") = Trim(Text1(2).Text)
      frmEdbook.Adodc1.Recordset.Fields("作者") = Trim(Text1(3).Text)
      frmEdbook.Adodc1.Recordset.Fields("出版社") = Trim(DataCombo1.Text)
      frmEdbook.Adodc1.Recordset.Fields("定价") = Val(Trim(Text1(4).Text))
      frmEdbook.Adodc1.Recordset.Fields("入库日期") = Format(Trim(Text1(5).Text), "yyyy-mm-dd")
      frmEdbook.Adodc1.Recordset.Update
  End If
  Unload Me
End Sub

Private Sub Comm2_Click()  '取消
  Unload Me
End Sub

Private Sub DataCombo1_Click(Area As Integer)

End Sub

Private Sub DataCombo1_KeyPress(KeyAscii As Integer)
  Call endData(KeyAscii)
End Sub

Private Sub Form_Activate()
  Adodc1.Refresh
End Sub

Private Sub Form_Load()
  If flag = 2 Then '修改操作
   Text1(0).Text = frmEdbook.Adodc1.Recordset.Fields("图书编号") + ""
   Text1(1).Text = frmEdbook.Adodc1.Recordset.Fields("分类号") + ""
   Text1(2).Text = frmEdbook.Adodc1.Recordset.Fields("书名") + ""
   Text1(3).Text = frmEdbook.Adodc1.Recordset.Fields("作者") + ""
   DataCombo1.Text = frmEdbook.Adodc1.Recordset.Fields("出版社") + ""
   Text1(4).Text = frmEdbook.Adodc1.Recordset.Fields("定价") + ""
   Text1(5).Text = frmEdbook.Adodc1.Recordset.Fields("入库日期") + ""
   Text1(0).Enabled = False
  Else   '添加操作
    Text1(5).Text = Date
  End If
  
End Sub

Private Sub selcom_Click()
  tna = "press"
  cap = "出版社"
  frmedrec.Show vbModal
End Sub

Private Sub Text1_Change(Index As Integer)

End Sub

Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
  Call endData(KeyAscii)
End Sub

⌨️ 快捷键说明

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