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

📄 frmbookborrow.frm

📁 用vb实现的图书管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmBookBorrow 
   Caption         =   "书籍出借"
   ClientHeight    =   4185
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5790
   LinkTopic       =   "Form8"
   ScaleHeight     =   4185
   ScaleWidth      =   5790
   StartUpPosition =   3  '窗口缺省
   Begin VB.ComboBox Combo1 
      Height          =   300
      ItemData        =   "frmBookBorrow.frx":0000
      Left            =   2760
      List            =   "frmBookBorrow.frx":0007
      TabIndex        =   10
      Top             =   1200
      Width           =   2055
   End
   Begin VB.CommandButton Command3 
      Caption         =   "确定"
      Height          =   375
      Left            =   840
      TabIndex        =   9
      Top             =   3480
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   375
      Left            =   4080
      TabIndex        =   8
      Top             =   3480
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "清空"
      Height          =   375
      Left            =   2400
      TabIndex        =   7
      Top             =   3480
      Width           =   1095
   End
   Begin VB.TextBox txtDate 
      Height          =   375
      Left            =   2760
      TabIndex        =   6
      Top             =   1920
      Width           =   2055
   End
   Begin VB.TextBox txtMemo 
      Height          =   375
      Left            =   2760
      TabIndex        =   5
      Top             =   2640
      Width           =   2055
   End
   Begin VB.TextBox txtName 
      Height          =   375
      Left            =   2760
      TabIndex        =   4
      Top             =   480
      Width           =   2055
   End
   Begin VB.Label Lobe4 
      Caption         =   "备注"
      Height          =   255
      Left            =   840
      TabIndex        =   3
      Top             =   2640
      Width           =   1455
   End
   Begin VB.Label Label3 
      Caption         =   "书名"
      Height          =   255
      Left            =   840
      TabIndex        =   2
      Top             =   1200
      Width           =   1455
   End
   Begin VB.Label Labe2 
      Caption         =   "日期"
      Height          =   255
      Left            =   840
      TabIndex        =   1
      Top             =   1920
      Width           =   1455
   End
   Begin VB.Label Lsbe1 
      Caption         =   "借阅者姓名"
      Height          =   255
      Left            =   840
      TabIndex        =   0
      Top             =   480
      Width           =   1455
   End
End
Attribute VB_Name = "frmBookBorrow"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
txtName.Text = ""
txtDate.Text = ""
txtMemo.Text = ""
End Sub

Private Sub Command2_Click()
Unload Me

End Sub

Private Sub Command3_Click()
Dim conn As ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sql As String
Dim N As Boolean
N = True
Set conn = New ADODB.Connection

conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=book.mdb;Persist Security Info=False"
conn.Open
If Trim(txtName.Text) = "" Then
MsgBox "借阅者姓名不能为空", vbOKOnly + vbExclamation, ""
txtName.SetFocus
N = False
End If
If Trim(Combo1.Text) = "" Then
MsgBox "书名不能为空", vbOKOnly + vbExclamation, ""
N = False
End If
If Trim(txtDate.Text) = "" Then
MsgBox "日期不能为空", vbOKOnly + vbExclamation, ""
txtDate.SetFocus
N = False
End If
If N = True Then
sql = "select* from BorrowInfo"
rs.Open sql, conn, adOpenKeyset, adLockPessimistic
rs.AddNew
rs.Fields(1) = Trim(txtName.Text)
rs.Fields(2) = Trim(Combo1.Text)
rs.Fields(3) = Trim(txtDate.Text)
rs.Fields(4) = Trim(txtMemo.Text)
rs.Update
MsgBox "书籍出借已纪录", vbOKOnly + vbExclamation, ""
End If
End Sub

Private Sub Form_Load()
Dim conn As ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sql As String
Set conn = New ADODB.Connection

conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=book.mdb;Persist Security Info=False"
conn.Open

sql = "select*from BookInfo "
rs.Open sql, conn, adOpenKeyset, adLockPessimistic
rs.MoveFirst
Do While Not rs.EOF
  Combo1.AddItem rs.Fields(1)
  rs.MoveNext
Loop
rs.Close
conn.Close
End Sub

⌨️ 快捷键说明

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