最好是有做好的样本看看,要不说明一下用什么软件做?就是包括书号,作者什么的,还有索引文件……没学数据库,比较混乱啊,强人遇到帮个忙吧,不胜感激。
VERSION 5.00
Begin VB.Form frmSrchBookInfo
Caption = "搜索书籍信息"
ClientHeight = 5625
ClientLeft = 60
ClientTop = 345
ClientWidth = 7035
Icon = "frmSrchBookInfo.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5625
ScaleWidth = 7035
WindowState = 2 'Maximized
Begin VB.TextBox txtBookName
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 7
TabStop = 0 'False
Top = 1560
Width = 2535
End
Begin VB.Frame Frame1
Caption = "请输入书号并按回车"
ForeColor = &amt;H000000FF&amt;
Height = 735
Left = 480
TabIndex = 0
Top = 600
Width = 6135
Begin VB.TextBox txtBookId
BackColor = &amt;H0080FFFF&amt;
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &amt;H00FF0000&amt;
Height = 375
Left = 2640
TabIndex = 2
Top = 240
Width = 2415
End
Begin VB.CommandButton cmdBookOpen
Caption = "..."
BeginProperty Font
Name = "Tahoma"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5280
TabIndex = 3
Top = 240
Width = 495
End
Begin VB.Label lblBookId
AutoSize = -1 'True
Caption = "书号"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 240
TabIndex = 1
Top = 240
Width = 510
End
End
Begin VB.TextBox txtPubId
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 6
TabStop = 0 'False
Top = 2760
Width = 2655
End
Begin VB.TextBox txtCatId
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 5
TabStop = 0 'False
Top = 3360
Width = 2655
End
Begin VB.TextBox txtAuthor
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 4
TabStop = 0 'False
Top = 2160
Width = 2535
End
Begin VB.Label lblBookName
AutoSize = -1 'True
Caption = "书名"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1680
TabIndex = 12
Top = 1680
Width = 510
End
Begin VB.Label lblPubId
AutoSize = -1 'True
Caption = "出版社号"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1680
TabIndex = 11
Top = 2880
Width = 1020
End
Begin VB.Label lblCatId
AutoSize = -1 'True
Caption = "种类号"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1680
TabIndex = 10
Top = 3480
Width = 765
End
Begin VB.Label lblInfo
Alignment = 2 'Center
BackColor = &amt;H00800000&amt;
Caption = "搜索书籍信息"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &amt;H00FFFFFF&amt;
Height = 375
Left = 0
TabIndex = 9
Top = 0
Width = 5775
End
Begin VB.Label lblAuthor
AutoSize = -1 'True
Caption = "作者"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1680
TabIndex = 8
Top = 2280
Width = 510
End
End
Attribute VB_Name = "frmSrchBookInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
'设定标签
lblInfo.Left = Me.ScaleLeft
lblInfo.Top = Me.ScaleTop
lblInfo.Width = Screen.Width
End Sub
Private Sub Form_Activate()
clear
End Sub
Private Sub cmdBookOpen_Click()
frmBookInfo.Show
frmBookInfo.SetFocus
End Sub
'========================================================
'连接数据库
'========================================================
'清空textBox
Private Sub clear()
txtBookId.Text = ""
txtBookName.Text = ""
txtAuthor.Text = ""
txtPubId.Text = ""
txtCatId.Text = ""
txtBookId.SetFocus
End Sub
Private Sub Txtbookid_KeyPress(KeyAscii As Integer)
Dim BookNo As String
'指派查询关键值
BookNo = txtBookId.Text
'如果输入回车
If KeyAscii = 13 Then
clear
If Not IsNumeric(BookNo) Then
MsgBox "输入搜索关键字错误!", vbCritical, "查找错误"
Call clear
Exit Sub
End If
rsBookInfo.MoveFirst
For i = 0 To rsBookInfo.RecordCount
If rsBookInfo.EOF = True Then
Exit For
End If
If rsBookInfo(0) = Val(Trim$(BookNo)) Then
txtBookName.Text = rsBookInfo(1)
txtAuthor.Text = rsBookInfo(2)
txtPubId.Text = rsBookInfo(3)
txtCatId.Text = rsBookInfo(4)
Exit For
End If
rsBookInfo.MoveNext
Next
If txtBookName.Text = "" Then
MsgBox "此书不存在!", vbInformation, "没有找到"
'cmdSave.Enabled = False
clear
End If
End If
End Sub
VERSION 5.00
Begin VB.Form frmSrchIssue
Caption = "搜索借出书信息"
ClientHeight = 5760
ClientLeft = 60
ClientTop = 345
ClientWidth = 6975
Icon = "frmSrchIssue.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5760
ScaleWidth = 6975
WindowState = 2 'Maximized
Begin VB.TextBox txtLibraryId
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 7
TabStop = 0 'False
Top = 2160
Width = 2655
End
Begin VB.TextBox txtReturnDate
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 14
Top = 2160
Visible = 0 'False
Width = 2535
End
Begin VB.CommandButton cmdMemberOpen
Caption = "..."
BeginProperty Font
Name = "Tahoma"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5880
TabIndex = 8
Top = 2160
Width = 495
End
Begin VB.TextBox txtFineAmt
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 6
TabStop = 0 'False
Top = 3360
Width = 2655
End
Begin VB.TextBox txtDaysUsed
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 5
TabStop = 0 'False
Top = 2760
Width = 2655
End
Begin VB.Frame Frame1
Caption = "请输入书号并按回车"
ForeColor = &amt;H000000FF&amt;
Height = 735
Left = 480
TabIndex = 0
Top = 600
Width = 6135
Begin VB.CommandButton cmdBookOpen
Caption = "..."
BeginProperty Font
Name = "Tahoma"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5280
TabIndex = 3
Top = 240
Width = 495
End
Begin VB.TextBox txtBookId
BackColor = &amt;H0080FFFF&amt;
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &amt;H00FF0000&amt;
Height = 375
Left = 2640
TabIndex = 2
Top = 240
Width = 2415
End
Begin VB.Label lblBookId
AutoSize = -1 'True
Caption = "书号"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 240
TabIndex = 1
Top = 240
Width = 510
End
End
Begin VB.TextBox txtIssueDate
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 4
TabStop = 0 'False
Top = 1560
Width = 2535
End
Begin VB.Label lblLibraryId
AutoSize = -1 'True
Caption = "借书证号"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 720
TabIndex = 12
Top = 2160
Width = 1020
End
Begin VB.Label lblInfo
Alignment = 2 'Center
BackColor = &amt;H00800000&amt;
Caption = "搜索借出书信息"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &amt;H00FFFFFF&amt;
Height = 375
Left = 0
TabIndex = 13
Top = 0
Width = 5775
End
Begin VB.Label lblFineAmt
AutoSize = -1 'True
Caption = "费用数目"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 720
TabIndex = 11
Top = 3360
Width = 1020
End
Begin VB.Label lblDaysUsed
AutoSize = -1 'True
Caption = "借出天数"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 720
TabIndex = 10
Top = 2760
Width = 1020
End
Begin VB.Label lblIssueDate
AutoSize = -1 'True
Caption = "借出日期"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 720
TabIndex = 9
Top = 1560
Width = 1020
End
End
Attribute VB_Name = "frmSrchIssue"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
'设定标签
lblInfo.Left = Me.ScaleLeft
lblInfo.Top = Me.ScaleTop
lblInfo.Width = Screen.Width
txtFineAmt.Visible = False
lblFineAmt.Visible = False
'Frame2.Left = (Screen.Width - Frame2.Width) / 2
If rsIssueInfo.RecordCount = 0 Then
MsgBox "没有书借出!", vbInformation, "借书记录"
Unload Me
End If
'cmdSave.Enabled = False
End Sub
Private Sub Form_Activate()
clear
End Sub
Private Sub cmdBookOpen_Click()
frmBookInfo.Show
frmBookInfo.SetFocus
End Sub
Private Sub cmdMemberOpen_Click()
frmMemberInfo.Show
frmMemberInfo.SetFocus
End Sub
'========================================================
'连接数据库
'========================================================
Private Sub clear()
txtIssueDate.Text = ""
txtBookId.Text = ""
txtDaysUsed.Text = ""
txtFineAmt.Text = ""
txtLibraryId.Text = ""
txtReturnDate.Text = ""
txtFineAmt.Visible = False
lblFineAmt.Visible = False
txtBookId.SetFocus
End Sub
Private Sub Txtbookid_KeyPress(KeyAscii As Integer)
Dim BookNo As String
Dim issueDate As Date
Dim currDate As Date
Dim totalDaysUsed As Integer
Dim totalFineAmt As Integer
'指派查询关键值
BookNo = txtBookId.Text
If KeyAscii = 13 Then
clear
If Not IsNumeric(BookNo) Then
MsgBox "输入搜索关键字错误", vbCritical, "搜索失败"
Call clear
Exit Sub
End If
rsIssueInfo.MoveFirst
For i = 0 To rsIssueInfo.RecordCount
If rsIssueInfo.EOF = True Then
Exit For
End If
If rsIssueInfo(0) = Val(Trim$(BookNo)) Then
txtLibraryId.Text = rsIssueInfo(2)
txtReturnDate.Text = Format(Now, "yy/mm/dd/")
txtIssueDate.Text = rsIssueInfo(1)
issueDate = CDate(txtIssueDate.Text)
currDate = CDate(Format(Now, "yy/mm/dd"))
totalDaysUsed = DateDiff("d", issueDate, currDate)
If totalDaysUsed > maxDays Then
txtFineAmt.Visible = True
lblFineAmt.Visible = True
totalDaysUsed = totalDaysUsed - maxDays
totalFineAmt = fineAmt * totalDaysUsed
txtDaysUsed.ForeColor = vbRed
txtFineAmt.ForeColor = vbRed
txtDaysUsed.Text = "超出期限 " &amt; totalDaysUsed &amt; " 天!"
txtFineAmt.Text = "收费 " &amt; totalFineAmt
Else
txtDaysUsed.ForeColor = vbBlack
txtFineAmt.Visible = False
lblFineAmt.Visible = False
txtDaysUsed.Text = totalDaysUsed
End If
Exit For
End If
rsIssueInfo.MoveNext
Next
If txtLibraryId.Text = "" Then
MsgBox "此书未借出", vbInformation, ""
'cmdSave.Enabled = False
clear
End If
End If
End Sub
VERSION 5.00
Begin VB.Form frmSrchMember
Caption = "搜索"
ClientHeight = 5730
ClientLeft = 60
ClientTop = 345
ClientWidth = 7260
Icon = "frmSrchMember.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5730
ScaleWidth = 7260
WindowState = 2 'Maximized
Begin VB.TextBox txtAddress
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 12
TabStop = 0 'False
Top = 3960
Width = 2655
End
Begin VB.TextBox txtRollNo
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 7
TabStop = 0 'False
Top = 2160
Width = 2535
End
Begin VB.TextBox txtSex
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 6
TabStop = 0 'False
Top = 3360
Width = 2655
End
Begin VB.TextBox txtMemName
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 5
TabStop = 0 'False
Top = 2760
Width = 2655
End
Begin VB.Frame Frame1
Caption = "请输入会员号并按回车"
ForeColor = &amt;H000000FF&amt;
Height = 735
Left = 4
Begin VB.Form frmSrchBookInfo
Caption = "搜索书籍信息"
ClientHeight = 5625
ClientLeft = 60
ClientTop = 345
ClientWidth = 7035
Icon = "frmSrchBookInfo.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5625
ScaleWidth = 7035
WindowState = 2 'Maximized
Begin VB.TextBox txtBookName
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 7
TabStop = 0 'False
Top = 1560
Width = 2535
End
Begin VB.Frame Frame1
Caption = "请输入书号并按回车"
ForeColor = &amt;H000000FF&amt;
Height = 735
Left = 480
TabIndex = 0
Top = 600
Width = 6135
Begin VB.TextBox txtBookId
BackColor = &amt;H0080FFFF&amt;
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &amt;H00FF0000&amt;
Height = 375
Left = 2640
TabIndex = 2
Top = 240
Width = 2415
End
Begin VB.CommandButton cmdBookOpen
Caption = "..."
BeginProperty Font
Name = "Tahoma"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5280
TabIndex = 3
Top = 240
Width = 495
End
Begin VB.Label lblBookId
AutoSize = -1 'True
Caption = "书号"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 240
TabIndex = 1
Top = 240
Width = 510
End
End
Begin VB.TextBox txtPubId
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 6
TabStop = 0 'False
Top = 2760
Width = 2655
End
Begin VB.TextBox txtCatId
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 5
TabStop = 0 'False
Top = 3360
Width = 2655
End
Begin VB.TextBox txtAuthor
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 4
TabStop = 0 'False
Top = 2160
Width = 2535
End
Begin VB.Label lblBookName
AutoSize = -1 'True
Caption = "书名"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1680
TabIndex = 12
Top = 1680
Width = 510
End
Begin VB.Label lblPubId
AutoSize = -1 'True
Caption = "出版社号"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1680
TabIndex = 11
Top = 2880
Width = 1020
End
Begin VB.Label lblCatId
AutoSize = -1 'True
Caption = "种类号"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1680
TabIndex = 10
Top = 3480
Width = 765
End
Begin VB.Label lblInfo
Alignment = 2 'Center
BackColor = &amt;H00800000&amt;
Caption = "搜索书籍信息"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &amt;H00FFFFFF&amt;
Height = 375
Left = 0
TabIndex = 9
Top = 0
Width = 5775
End
Begin VB.Label lblAuthor
AutoSize = -1 'True
Caption = "作者"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1680
TabIndex = 8
Top = 2280
Width = 510
End
End
Attribute VB_Name = "frmSrchBookInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
'设定标签
lblInfo.Left = Me.ScaleLeft
lblInfo.Top = Me.ScaleTop
lblInfo.Width = Screen.Width
End Sub
Private Sub Form_Activate()
clear
End Sub
Private Sub cmdBookOpen_Click()
frmBookInfo.Show
frmBookInfo.SetFocus
End Sub
'========================================================
'连接数据库
'========================================================
'清空textBox
Private Sub clear()
txtBookId.Text = ""
txtBookName.Text = ""
txtAuthor.Text = ""
txtPubId.Text = ""
txtCatId.Text = ""
txtBookId.SetFocus
End Sub
Private Sub Txtbookid_KeyPress(KeyAscii As Integer)
Dim BookNo As String
'指派查询关键值
BookNo = txtBookId.Text
'如果输入回车
If KeyAscii = 13 Then
clear
If Not IsNumeric(BookNo) Then
MsgBox "输入搜索关键字错误!", vbCritical, "查找错误"
Call clear
Exit Sub
End If
rsBookInfo.MoveFirst
For i = 0 To rsBookInfo.RecordCount
If rsBookInfo.EOF = True Then
Exit For
End If
If rsBookInfo(0) = Val(Trim$(BookNo)) Then
txtBookName.Text = rsBookInfo(1)
txtAuthor.Text = rsBookInfo(2)
txtPubId.Text = rsBookInfo(3)
txtCatId.Text = rsBookInfo(4)
Exit For
End If
rsBookInfo.MoveNext
Next
If txtBookName.Text = "" Then
MsgBox "此书不存在!", vbInformation, "没有找到"
'cmdSave.Enabled = False
clear
End If
End If
End Sub
VERSION 5.00
Begin VB.Form frmSrchIssue
Caption = "搜索借出书信息"
ClientHeight = 5760
ClientLeft = 60
ClientTop = 345
ClientWidth = 6975
Icon = "frmSrchIssue.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5760
ScaleWidth = 6975
WindowState = 2 'Maximized
Begin VB.TextBox txtLibraryId
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 7
TabStop = 0 'False
Top = 2160
Width = 2655
End
Begin VB.TextBox txtReturnDate
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 14
Top = 2160
Visible = 0 'False
Width = 2535
End
Begin VB.CommandButton cmdMemberOpen
Caption = "..."
BeginProperty Font
Name = "Tahoma"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5880
TabIndex = 8
Top = 2160
Width = 495
End
Begin VB.TextBox txtFineAmt
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 6
TabStop = 0 'False
Top = 3360
Width = 2655
End
Begin VB.TextBox txtDaysUsed
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 5
TabStop = 0 'False
Top = 2760
Width = 2655
End
Begin VB.Frame Frame1
Caption = "请输入书号并按回车"
ForeColor = &amt;H000000FF&amt;
Height = 735
Left = 480
TabIndex = 0
Top = 600
Width = 6135
Begin VB.CommandButton cmdBookOpen
Caption = "..."
BeginProperty Font
Name = "Tahoma"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5280
TabIndex = 3
Top = 240
Width = 495
End
Begin VB.TextBox txtBookId
BackColor = &amt;H0080FFFF&amt;
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &amt;H00FF0000&amt;
Height = 375
Left = 2640
TabIndex = 2
Top = 240
Width = 2415
End
Begin VB.Label lblBookId
AutoSize = -1 'True
Caption = "书号"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 240
TabIndex = 1
Top = 240
Width = 510
End
End
Begin VB.TextBox txtIssueDate
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 4
TabStop = 0 'False
Top = 1560
Width = 2535
End
Begin VB.Label lblLibraryId
AutoSize = -1 'True
Caption = "借书证号"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 720
TabIndex = 12
Top = 2160
Width = 1020
End
Begin VB.Label lblInfo
Alignment = 2 'Center
BackColor = &amt;H00800000&amt;
Caption = "搜索借出书信息"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &amt;H00FFFFFF&amt;
Height = 375
Left = 0
TabIndex = 13
Top = 0
Width = 5775
End
Begin VB.Label lblFineAmt
AutoSize = -1 'True
Caption = "费用数目"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 720
TabIndex = 11
Top = 3360
Width = 1020
End
Begin VB.Label lblDaysUsed
AutoSize = -1 'True
Caption = "借出天数"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 720
TabIndex = 10
Top = 2760
Width = 1020
End
Begin VB.Label lblIssueDate
AutoSize = -1 'True
Caption = "借出日期"
BeginProperty Font
Name = "新宋体"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 720
TabIndex = 9
Top = 1560
Width = 1020
End
End
Attribute VB_Name = "frmSrchIssue"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
'设定标签
lblInfo.Left = Me.ScaleLeft
lblInfo.Top = Me.ScaleTop
lblInfo.Width = Screen.Width
txtFineAmt.Visible = False
lblFineAmt.Visible = False
'Frame2.Left = (Screen.Width - Frame2.Width) / 2
If rsIssueInfo.RecordCount = 0 Then
MsgBox "没有书借出!", vbInformation, "借书记录"
Unload Me
End If
'cmdSave.Enabled = False
End Sub
Private Sub Form_Activate()
clear
End Sub
Private Sub cmdBookOpen_Click()
frmBookInfo.Show
frmBookInfo.SetFocus
End Sub
Private Sub cmdMemberOpen_Click()
frmMemberInfo.Show
frmMemberInfo.SetFocus
End Sub
'========================================================
'连接数据库
'========================================================
Private Sub clear()
txtIssueDate.Text = ""
txtBookId.Text = ""
txtDaysUsed.Text = ""
txtFineAmt.Text = ""
txtLibraryId.Text = ""
txtReturnDate.Text = ""
txtFineAmt.Visible = False
lblFineAmt.Visible = False
txtBookId.SetFocus
End Sub
Private Sub Txtbookid_KeyPress(KeyAscii As Integer)
Dim BookNo As String
Dim issueDate As Date
Dim currDate As Date
Dim totalDaysUsed As Integer
Dim totalFineAmt As Integer
'指派查询关键值
BookNo = txtBookId.Text
If KeyAscii = 13 Then
clear
If Not IsNumeric(BookNo) Then
MsgBox "输入搜索关键字错误", vbCritical, "搜索失败"
Call clear
Exit Sub
End If
rsIssueInfo.MoveFirst
For i = 0 To rsIssueInfo.RecordCount
If rsIssueInfo.EOF = True Then
Exit For
End If
If rsIssueInfo(0) = Val(Trim$(BookNo)) Then
txtLibraryId.Text = rsIssueInfo(2)
txtReturnDate.Text = Format(Now, "yy/mm/dd/")
txtIssueDate.Text = rsIssueInfo(1)
issueDate = CDate(txtIssueDate.Text)
currDate = CDate(Format(Now, "yy/mm/dd"))
totalDaysUsed = DateDiff("d", issueDate, currDate)
If totalDaysUsed > maxDays Then
txtFineAmt.Visible = True
lblFineAmt.Visible = True
totalDaysUsed = totalDaysUsed - maxDays
totalFineAmt = fineAmt * totalDaysUsed
txtDaysUsed.ForeColor = vbRed
txtFineAmt.ForeColor = vbRed
txtDaysUsed.Text = "超出期限 " &amt; totalDaysUsed &amt; " 天!"
txtFineAmt.Text = "收费 " &amt; totalFineAmt
Else
txtDaysUsed.ForeColor = vbBlack
txtFineAmt.Visible = False
lblFineAmt.Visible = False
txtDaysUsed.Text = totalDaysUsed
End If
Exit For
End If
rsIssueInfo.MoveNext
Next
If txtLibraryId.Text = "" Then
MsgBox "此书未借出", vbInformation, ""
'cmdSave.Enabled = False
clear
End If
End If
End Sub
VERSION 5.00
Begin VB.Form frmSrchMember
Caption = "搜索"
ClientHeight = 5730
ClientLeft = 60
ClientTop = 345
ClientWidth = 7260
Icon = "frmSrchMember.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5730
ScaleWidth = 7260
WindowState = 2 'Maximized
Begin VB.TextBox txtAddress
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 12
TabStop = 0 'False
Top = 3960
Width = 2655
End
Begin VB.TextBox txtRollNo
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 7
TabStop = 0 'False
Top = 2160
Width = 2535
End
Begin VB.TextBox txtSex
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 6
TabStop = 0 'False
Top = 3360
Width = 2655
End
Begin VB.TextBox txtMemName
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3120
Locked = -1 'True
TabIndex = 5
TabStop = 0 'False
Top = 2760
Width = 2655
End
Begin VB.Frame Frame1
Caption = "请输入会员号并按回车"
ForeColor = &amt;H000000FF&amt;
Height = 735
Left = 4
温馨提示:答案为网友推荐,仅供参考
第1个回答 2008-06-07
啊啊,这个得先分析图书的数据类型,档案管理学里有,什么书号,类,章,目什么的,我设计过忘了。