0% found this document useful (0 votes)
154 views

Project Report

This document provides an overview of a library management system project created using Visual Basic and Microsoft Access. It includes an 11 page table of contents that lists the main sections and pages of the project report. The sections include acknowledgments, introduction, platform used, front end and back end details, testing mechanisms, an introduction to Visual Basic, the database structure, coding details, output details, and conclusions.

Uploaded by

amansaini29
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
154 views

Project Report

This document provides an overview of a library management system project created using Visual Basic and Microsoft Access. It includes an 11 page table of contents that lists the main sections and pages of the project report. The sections include acknowledgments, introduction, platform used, front end and back end details, testing mechanisms, an introduction to Visual Basic, the database structure, coding details, output details, and conclusions.

Uploaded by

amansaini29
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 85

SR.no. CONTENTS PAGE NO. SIG.

1 Acknowledgement 2

2 Introduction to Project 3

3 Platform Used 5

4 Front end and Back end 6

5 Testing Mechanisms 7

6 Introduction to VB 8

7 Database Structure 9

8 Coding Project 20

9 Output Project 64

10 Conclusion 79

11 Bibliography 80

1
ACKNOWLEDGEMENT

This project report file on LIBRARY MANGEMENT SYSTEM is being


made by the help of my teacher Ms. NAMARTA and my colleagues. I am
very thank full to them for there fully hearted support given me to make this
file. I also gratefully acknowledge the contribution of some reference book
that gives some idea to make this file.

SUBMITTED TO: SUBMITTED BY:

Ms.NAMRTA RAJESH SINGH (9025)


BCA 6th SEM
80907219025

2
INTRODUCTION

Since it was compulsory that a project work be under taken, we consulted

among ourselves and decided to take up the Library System as my project.

After collecting the necessary information from different teachers, peoples and

our colleagues we suitably developed the software package to meet user

requirements. . This project was done on Celeron or higher configuration.

With the help of this project we can maintain books record, student report.

In this project we can store information about a student as well as teacher, who

has the member ship in the library system. And according to his/her

membership in the library, we can issue

books of a person has not any member ship number. Then he cannot issue the

book. In this project we have provides information about books and how many

books in the library. It gives information about books name. if there are some

new books for library then it can be added to the software and issue .

3
In one more feature of this project is that any teacher cannot issue more then

two books. This too can change according to need.

This project also provides us the book issue and return facility. This is the

main feature of our project. This project also provides the show details report

facility which tells the student to see which book is currently issued. It shows

the report total books in the library.

In this project we have given password to the software for the security. If the

user know about the password then he can use and otherwise not. It also can

calculate fine for a student on a back. After fifteen days if a student does not

return the back then he has to pay the fine.

This project is made by using front end tool visual basic and backend tool

access. All the tables of access are firstly copy to c:\ drive for store the data.

This facility is also available in our project. The access table can be copied

hard disk to CD drive and from CD to hard disk. So these are the main feature

of our project which satisfies all the requirement of our college’s library

4
Platform Used: ----

Windows XP (professional)
This is exactly the window graphical user interface

5
Front & Back end used

Front End: - Visual Basic:- Visual Basic is a Windows programming

language that has been developed at Microsoft Corporation. Visual Basic is a

powerful programming language to develop sophisticated windows programs

very quickly. Visual Basic applications are very popular as front-end to many

Client/Server database systems like SQL/Server, Oracle etc.

Back end: - MS-Access:-Ms Access is a powerful multi-user DBMS

developed by Microsoft corp. It can be used to store and manipulate large

amounts of information and automate repetitive tasks. By using Access you

can develop easy to use data input forms .data in access store in the form of

tables

6
Testing mechanisms
This Project was testing on Celeron or any higher system as like P-III or P-IV

7
Introduction of Visual Basic

Visual Basic-6 is a development environment that runs under Microsoft


Windows. It is used to write programs that also run under Microsoft Windows.

It is the programming environment used by more programmer than any other


in the history (more than 3 million). It combines extraordinary ease of use with
great power and flexibility. Visual Basic is used in many ways and at many
levels from novice programmers to the expert’s artists of programming.

Visual Basic language is having several faces. One is Visual, which comprises
of objects and tools that easily assembles themselves into a modern Windows
interface.

Another face is the Visual Basic language, which is an outcome of the original
BASIC language. BASIC (Beginners All-Purpose Symbolic Instruction Code).
BASIC was invented in the early 1960s. It was intended to be as easy to
understand and as close to layman language as possible.

8
Visual Basic has kept the BASIC tradition intact in this respect. It is one of the
easiest computer languages to work with and understand.

Data Controls

(a) Data Control : This control is the most versatile to cruise through a
Database, but it has its own limitations on the programming interface.

(b) ADO Data Control : This control is more versatile in the way that the
program code is more compact and making relationships between various
controls is very simple.

OBJECTIVES

The project aims at making invoice transactions more versatile. Various


invoice programs made in languages like FoxPro and Dbase are generally
crude. This program is structured in “Visual Basic” ,which being based on
windows, is more versatile and user friendly.

9
PROJECT CATEGORY The project categorizes itself in Visual
Basic. For database management it uses Jet Database engine which works
behind Microsoft Access. It uses Data Controls.

TOOLS AND ENVIRONMENT USED

Visual Basic IDE : This is the most amazing and useful component of
Visual Basic, this is the built in IDE or Integrated Development Environment.
In older versions of visual basic programmers used a text editor(similar to
word processor) to write and make changes to their code, but with Visual
Basic IDE one can easily design screens tables etc using inbuilt controls and
IDE actually writes code for these controls on its own for carrying out the
design constructions.

Windows GUI : Window based GUI offers more computability in dealing


with all kinds of people , people who know computers and also people who

10
don’t know computers. This project being on the platform of windows
incorporates all its versatile genuine features.

Some important features are used in this project:

MENU EDITOR
“Menu Editor” Utility of VB can be accessed from Tools menu in the
Forms Design screen. This utility is used for creating menus. It allows you to
create custom menus for your application and to define their properties

TOOLBAR:
Toolbars are a collection of icons, which provide mouse-driven short-
cuts to menu options. The toolbar can be easily added to the form by

including the component named, Microsoft Windows Common Controls 6.0.

STATUS BAR
The Status bar is a common Windows feature. The Status bar is
normally at the bottom of a window and on the status bar certain information
in displayed like date, time etc. The status bar can be easily added to your
form as it is available as a control in the component, Microsoft Windows
Common controls 6.0.

11
VARIABLES
We often need to store values temporarily when performing calculations with
Visual Basic. For example, we might want to calculate several values,
compare them and perform different operations on them, depending on the
result of the comparison. We need to retain the values if we want to compare
them but not store them in a property

Label: The label control displays text a user cannot interact with or modify.

Textbox: The text box control provides an area to enter or display text.

Frame: The frame control provides a visual and functional container for
controls

Command Button: The Command button control carries out a command


or action when a user chooses it.

Checkbox: The check box control displays a True/False or Yes/No option.


You can check any number of check boxes on a form at one time.

Option Button: The option button control, as a part of an option group


with other option buttons, displays multiple choices, from which a user can
choose only one.

12
Combo Box: The Combo box control combines a text box with a list box.
Allows a user to type in a selection or select an item from a drop-down list.

List Box: The list box control displays a list of items that a user can choose
from.

Timer: The timer control executes timer events at specified time


interval

TABLE STRUCTURE

1. Add (Add new book)

FIELD NAME TYPE SIZE

13
BCODE NUMBER 2

BNAME TEXT 200

AUTHOR TEXT 50

PUB TEXT 50

NOC NUMBER 2

DATE TEXT 50

IBOOK NUMBER 2

RBOOK NUMBER 2

2. ibook

FIELD NAME TYPE SIZE

14
DATE TEXT 2

BNAME TEXT 50

AUTHOR TEXT 50

PUB TEXT 50

STOCK NUMBER 2

CLASS TEXT 50

ROLL NUMBER 2

NAME TEXT 50

BNO NUMBER 50

3. rbooks

15
FIELD NAME TYPE SIZE

RDATE TEXT 50

BNO NUMBER 2

CLASS TEXT 50

ROLL NUMBER 2

NAME TEXT 50

BNAME TEXT 50

AUTHOR TEXT 50

PUB TEXT 50

IDATE TEXT 50

FINE NUMBER 2

4. student

16
FIELD NAME TYPE SIZE

NAME TEXT 150

DOB TEXT 50

SEX TEXT 50

FNAME TEXT 50

OCC TEXT 50

ADD TEXT 50

PHONE NUMBER 2

ADATE TEXT 50

CLASS TEXT 50

ROLL NUMBER 2

SEM NUMBER 2

5. teacher
17
FIELD NAME TYPE SIZE

ID NUMER 2

NAME TEXT 50

DOB TEXT 50

SEX TEXT 50

MS TEXT 50

EQ TEXT 50

EX TEXT 50

FNAME TEXT 50

ADD TEXT 50

TEL NUMBER 2

CDATE TEXT 50

DOJ TEXT 50

18
6. tibook

FIELD NAME TYPE SIZE

IDATE TEXT 50

TDATE TEXT 50

AUTHOR TEXT 50

PUB TEXT 150

STOCK NUMBER 2

TNAME TEXT 50

ID NUMBER 2

BN NUMBER 2

19
7. trbook

FIELD NAME TYPE SIZE

CDATE TEXT 50

BN NUMBER 2

TNAME TEXT 50

INAME TEXT 50

BNAME TEXT 50

TNAME TEXT 50

AUTHOR TEXT 50

PUB TEXT 50

20
CODING

OF

PROJECT

21
Sub bu_Click()
If MsgBox("Insert the floppy into A: Drive to write BackUp data.",
vbOKCancel, "Take BackUp") = vbCancel Then Exit Sub
BackUp
Form1(library.frm)
Private Sub ad_Click()
Form10.Show
End Sub
Private Sub am_Click()
frmabout.Show
End Sub

Private End Sub

Private Sub Exit_Click()


Form13.Show
Unload Me

End Sub

Private Sub ht_Click()


MsgBox "No help Available", vbInformation, "Library"
End Sub

Private Sub Label1_Click()

End Sub

Private Sub mnat_Click()


Form11.Show
End Sub

Private Sub nb_Click()


22
Form2.Show
End Sub

Private Sub re_Click()


If MsgBox("Insert the floppy into A: Drive to read BackUp data.",
vbOKCancel, "Restore BackUp") = vbCancel Then Exit Sub
Restore
End Sub

Private Sub s3_Click()


Form7.Show
End Sub

Private Sub si_Click()


Form9.Show
End Sub

Private Sub st_Click()


Form5.Show
End Sub

Private Sub t_Click()


Form3.Show
End Sub

Private Sub te_Click()


Form4.Show
End Sub

Private Sub te1_Click()


Form6.Show
End Sub

23
Private Sub te3_Click()

Form8.Show
End Sub

Public Sub BackUp()


Err.Clear
On Error Resume Next
FileCopy "C:\library.mdb", "A:\library.mdb"
If Err.Number > 0 Then
If MsgBox("Unable to write on disk." & vbCrLf & Err.Description &
".", _
vbRetryCancel + vbCritical, "BackUp") = vbRetry Then BackUp
End If
End Sub

Public Sub Restore()


Err.Clear
On Error Resume Next
FileCopy "A:\library.mdb", "C:\library.mdb"
If Err.Number > 0 Then
If MsgBox("Unable to read disk." & vbCrLf & Err.Description & ".",
_
vbRetryCancel + vbCritical, "Rstore BackUp.") = vbRetry Then
Restore
End If
End Sub

Private Sub Timer1_Timer()

24
Label1.Caption = Mid(Label1.Caption, 2, Len(Label1.Caption)) +
Mid(Label1.Caption, 1, 1)
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As


MSComctlLib.Button)

Select Case Button.Index


Case 1
Form10.Show
Case 2
Form11.Show
Case 4

Form3.Show
Case 5
Form4.Show
Case 7
Form5.Show
Case 8
Form6.Show
Case 10
Form7.Show
Case 11
Form8.Show
Case 13
Form9.Show

Case 15
Form2.Show

End Select

25
Form2(addnew.frm)

Dim bc As Integer
Private Sub Command1_Click()
Command2.Enabled = True
Command1.Enabled = False

Data1.Recordset.Fields("date").Value = Date

Data1.Recordset.Fields("rbook").Value = Val(Text4.Text)
Data1.Recordset.Fields("ibook").Value = 0
Data1.Recordset.Update
MsgBox "Book Added Successfully", vbOKOnly + vbInformation,
"Library System.."
Data1.Recordset.MoveFirst

End Sub

Private Sub Command2_Click()


Command2.Enabled = False
Command1.Enabled = False
Data1.Recordset.AddNew
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Combo1.Text = " "
Text2.SetFocus
bc = bc + 1
Text1.Text = bc
End Sub

Private Sub Form_Activate()


Text2.SetFocus
Data1.Recordset.MoveLast

26
bc = Data1.Recordset.Fields("bcode").Value
Text1.Text = bc
End Sub

Private Sub Form_Load()


Command1.Enabled = False

Text5.Text = Date
End Sub
Private Sub Text4_LostFocus()
Command1.Enabled = True
End Sub

Form3(issue.frm)

Dim S As String
Dim temp As String
Dim a As String
Dim t As Integer

Private Sub Combo1_Click()


Combo2.Clear
Text1.Text = " "
Text2.Text = " "
S = Combo1.Text

Dim y As Integer

Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF
y=0

27
If Data1.Recordset.Fields("bname").Value = S Then
y=1
End If

'Combo2.AddItem (Data1.Recordset.Fields("author").Value)
'Exit Do
'Else
If y = 1 Then
Combo2.AddItem (Data1.Recordset.Fields("author").Value)
End If
Data1.Recordset.MoveNext
'End If
Loop
End Sub

Private Sub Combo2_Click()


Text1.Text = " "
Text2.Text = " "

temp = Combo2.Text

Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF

If Data1.Recordset.Fields("author").Value = temp And S =


Data1.Recordset.Fields("bname").Value Then

Text1.Text = Data1.Recordset.Fields("pub").Value
Text2.Text = Data1.Recordset.Fields("noc").Value

Exit Do
Else
Data1.Recordset.MoveNext

28
End If
Loop
End Sub

Private Sub Combo3_Click()


Combo4.Clear
a = Combo3.Text
Dim y As Integer
Data2.Recordset.MoveFirst
Do Until Data2.Recordset.EOF
y=0
If Data2.Recordset.Fields("class").Value = a Then
y=1
End If
If y = 1 Then
Combo4.AddItem (Data2.Recordset.Fields("roll").Value)

End If

Data2.Recordset.MoveNext
Loop

End Sub

Private Sub Combo4_Click()


t = Val(Combo4.Text)

Data2.Recordset.MoveFirst

Do Until Data2.Recordset.EOF
If t = Data2.Recordset.Fields("roll").Value Then
Text4.Text = Data2.Recordset.Fields("name").Value

29
Exit Do
End If

Data2.Recordset.MoveNext

Loop

End Sub

Private Sub Command1_Click()

Static ibb As Integer


Static rbb As Integer
Dim p As Integer
Dim tp As Integer

tp = Val(Text3.Text)
p=0

Data3.Recordset.MoveFirst
Do Until Data3.Recordset.EOF
If tp = Data3.Recordset.Fields("bno").Value Then
p=1
Exit Do
Else
Data3.Recordset.MoveNext
End If
Loop
If p = 1 Then
MsgBox "This Book No. is Invalid or book with this no. is Allready
Issued", vbOKOnly + vbInformation, "Library System.."
Text1.Text = " "
Text4.Text = " "

30
Text2.Text = " "
Text3.Text = " "
Combo1.Text = " "
Combo2.Text = " "
Combo3.Text = " "
Combo4.Text = " "
Else
Data3.Recordset.AddNew
Data3.Recordset.Fields("date").Value = Date
Data3.Recordset.Fields("bname").Value = S
Data3.Recordset.Fields("author").Value = temp
Data3.Recordset.Fields("pub").Value = Text1.Text
Data3.Recordset.Fields("stock").Value = Val(Text2.Text)
Data3.Recordset.Fields("class").Value = a
Data3.Recordset.Fields("roll").Value = t
Data3.Recordset.Fields("name").Value = Text4.Text
Data3.Recordset.Fields("bno").Value = Val(Text3.Text)
Data3.Recordset.Update
MsgBox "Book Issued", vbOKOnly + vbInformation, "Library
System.."
Text1.Text = " "
Text4.Text = " "
Text2.Text = " "

Text3.Text = " "


Combo1.Text = " "
Combo2.Text = " "
Combo3.Text = " "
Combo4.Text = " "
End

If p = 0 Then
Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF
If S = Data1.Recordset.Fields("bname").Value And temp =
Data1.Recordset.Fields("author").Value Then

31
rbb = Data1.Recordset.Fields("rbook").Value
ibb = Data1.Recordset.Fields("ibook").Value
If rbb <= 0 Then

MsgBox "Sorry All Books are Allready Issued", vbOKOnly +


vbInformation, "Library System.."
Else
rbb = rbb - 1
ibb = ibb + 1
Data1.Recordset.Edit
Data1.Recordset.Fields("rbook").Value = rbb
Data1.Recordset.Fields("ibook").Value = ibb
Data1.Recordset.Update
End If
Exit Do
Else
Data1.Recordset.MoveNext
End If
Loop
Else
MsgBox "This Book No. is Invalid or book with this no. is Allready
Issued", vbOKOnly + vbInformation, "Library System.."
Text1.Text = " "
Text4.Text = " "

Text2.Text = " "


Text3.Text = " "
Combo1.Text = " "
Combo2.Text = " "
Combo3.Text = " "
Combo4.Text = " "
End If

End Sub

32
Private Sub Form_Activate()

Data3.Recordset.MoveLast
Text6.Text = Data3.Recordset.Fields("bno").Value

Dim y As Integer
Dim y1 As String

Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF
y1 = Data1.Recordset.Fields("bname").Value
y=0
For j = 0 To Combo1.ListCount - 1
If Trim(Combo1.List(j)) = Trim(y1) Then
y=1
End If
Next j
If y = 0 Then
Combo1.AddItem (y1)
End If
Data1.Recordset.MoveNext
Loop

Dim x As Integer
Dim x1 As String

Data2.Recordset.MoveFirst
Do Until Data2.Recordset.EOF
x1 = Data2.Recordset.Fields("class").Value
x=0
For j = 0 To Combo3.ListCount - 1
If Trim(Combo3.List(j)) = Trim(x1) Then

33
x=1
End If
Next j
If x = 0 Then
Combo3.AddItem (x1)
End If
Data2.Recordset.MoveNext
Loop

End Sub

Private Sub Form_Load()


Text5.Text = Date

End Sub

Form4(tissue.frm)

Dim S As String
Dim temp As String
Dim temp1 As String

Private Sub Combo1_Click()

Combo2.Clear
Text1.Text = " "
Text2.Text = " "
S = Combo1.Text

Dim y As Integer

34
Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF
y=0

If Data1.Recordset.Fields("bname").Value = S Then
y=1
End If

'Combo2.AddItem (Data1.Recordset.Fields("author").Value)
'Exit Do
'Else

If y = 1 Then
Combo2.AddItem (Data1.Recordset.Fields("author").Value)
End If

Data1.Recordset.MoveNext
'End If
Loop

End Sub

Private Sub Combo2_Click()


Text1.Text = " "
Text2.Text = " "

temp = Combo2.Text

Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF

35
If Data1.Recordset.Fields("author").Value = temp And S =
Data1.Recordset.Fields("bname").Value Then

Text1.Text = Data1.Recordset.Fields("pub").Value
Text2.Text = Data1.Recordset.Fields("noc").Value

Exit Do
Else
Data1.Recordset.MoveNext
End If
Loop
End Sub

Private Sub Combo3_Click()

temp1 = Combo3.Text

Data2.Recordset.MoveFirst
Do Until Data2.Recordset.EOF
If temp1 = Data2.Recordset.Fields("name").Value Then
Text4.Text = Data2.Recordset.Fields("id").Value
Exit Do
Else
Data2.Recordset.MoveNext
End If
Loop

End Sub

Private Sub Command1_Click()


Static ibb As Integer
Static rbb As Integer

36
Dim tp As Integer

tp = Val(Text3.Text)
p=0

Data3.Recordset.MoveFirst
Do Until Data3.Recordset.EOF
If tp = Data3.Recordset.Fields("bn").Value Then
p=1
Exit Do
Else
Data3.Recordset.MoveNext
End If
Loop
If p = 1 Then
MsgBox "Sorry ,this Book No. is Invalid or book with this no. is
Allready Issued", vbOKOnly + vbInformation, "Library System.."
Text1.Text = " "
Text2.Text = " "

Text3.Text = " "


Text4.Text = " "
Combo1.Text = " "
Combo2.Text = " "
Combo3.Text = " "
Else
Data3.Recordset.AddNew
Data3.Recordset.Fields("idate").Value = Date
Data3.Recordset.Fields("bname").Value = S
Data3.Recordset.Fields("author").Value = temp
Data3.Recordset.Fields("pub").Value = Text1.Text
Data3.Recordset.Fields("stock").Value = Val(Text2.Text)
Data3.Recordset.Fields("tname").Value = temp1

Data3.Recordset.Fields("id").Value = Val(Text4.Text)

37
Data3.Recordset.Fields("bn").Value = Val(Text3.Text)
Data3.Recordset.Update
MsgBox "Book Issued", vbOKOnly + vbInformation, "Library
System.."
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Combo1.Text = " "
Combo2.Text = " "
Combo3.Text = " "
End If

If p = 0 Then
Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF
If S = Data1.Recordset.Fields("bname").Value And temp =
Data1.Recordset.Fields("author").Value Then
rbb = Data1.Recordset.Fields("rbook").Value
ibb = Data1.Recordset.Fields("ibook").Value

If rbb <= 0 Then


MsgBox "Sorry Sir, All Books are Allready Issued", vbOKOnly +
vbInformation, "Library System.."
Else
rbb = rbb - 1
ibb = ibb + 1
Data1.Recordset.Edit
Data1.Recordset.Fields("rbook").Value = rbb
Data1.Recordset.Fields("ibook").Value = ibb

38
Data1.Recordset.Update
End If
Exit Do
Else
Data1.Recordset.MoveNext
End If
Loop
Else
MsgBox "Sorry ,this Book No. is Invalid or book with this no. is
Allready Issued", vbOKOnly + vbInformation, "Library System.."
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Combo1.Text = " "
Combo2.Text = " "
Combo3.Text = " "
End If

End Sub

Private Sub Form_Activate()


Data3.Recordset.MoveLast

Text6.Text = Data3.Recordset.Fields("bn").Value

Dim y As Integer
Dim y1 As String

Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF

39
y1 = Data1.Recordset.Fields("bname").Value
y=0
For j = 0 To Combo1.ListCount - 1
If Trim(Combo1.List(j)) = Trim(y1) Then
y=1
End If
Next j
If y = 0 Then
Combo1.AddItem (y1)
End If
Data1.Recordset.MoveNext
Loop

Data2.Recordset.MoveFirst
Do Until Data2.Recordset.EOF
Combo3.AddItem (Data2.Recordset.Fields("name").Value)
Data2.Recordset.MoveNext
Loop

End Sub

Private Sub Form_Load()


Text5.Text = Date

End Sub

Form5(sreturm.frm)

Dim temp As Integer


Dim temp1 As Integer

Private Sub Combo1_Click()


temp = Val(Combo1.Text)

40
End Sub

Private Sub Command1_Click()

Dim tbn As String


Dim tauthor As String

Static ibb As Integer


Static rbb As Integer

Command1.Enabled = False

temp1 = temp
Data2.Recordset.AddNew

Data2.Recordset.Fields("rdate").Value = Date
Data2.Recordset.Fields("bno").Value = temp
Data2.Recordset.Fields("class").Value = Text3.Text
Data2.Recordset.Fields("roll").Value = Val(Text1.Text)
Data2.Recordset.Fields("name").Value = Text2.Text
Data2.Recordset.Fields("bname").Value = Text7.Text
Data2.Recordset.Fields("author") = Text4.Text
Data2.Recordset.Fields("pub") = Text6.Text

Data2.Recordset.Fields("idate") = Text8.Text
Data2.Recordset.Fields("fine") = Val(Text9.Text)

Data2.Recordset.Update

41
MsgBox "Book Returned", vbOKOnly + vbInformation, "Library
System.."

Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF
If temp1 = Data1.Recordset.Fields("bno").Value Then

tbn = Data1.Recordset.Fields("bname").Value
tauthor = Data1.Recordset.Fields("author").Value

Data1.Recordset.Delete
Exit Do
Else
Data1.Recordset.MoveNext
End If
Loop

Combo1.Text = " "


Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Text6.Text = " "
Text7.Text = " "
Text8.Text = " "
Text9.Text = " "

Dim noc As Integer

42
Data3.Recordset.MoveFirst
Do Until Data3.Recordset.EOF

If tbn = Data3.Recordset.Fields("bname").Value And tauthor =


Data3.Recordset.Fields("author").Value Then

rbb = Data3.Recordset.Fields("rbook").Value

ibb = Data3.Recordset.Fields("ibook").Value
noc = Data3.Recordset.Fields("noc").Value

If rbb >= noc Then


MsgBox "Stock is Allready Complete", vbOKOnly + vbInformation,
"Library System.."
Else
rbb = rbb + 1
ibb = ibb - 1
End If

Data3.Recordset.Edit
Data3.Recordset.Fields("rbook").Value = rbb
Data3.Recordset.Fields("ibook").Value = ibb
Data3.Recordset.Update
Exit Do
Else
Data3.Recordset.MoveNext
End If
Loop

43
End Sub

Private Sub Command2_Click()


Command1.Enabled = True

Data1.Recordset.MoveFirst

Do Until Data1.Recordset.EOF
If temp = Data1.Recordset.Fields("bno").Value Then
Text3.Text = Data1.Recordset.Fields("class").Value
Text1.Text = Data1.Recordset.Fields("roll").Value
Text2.Text = Data1.Recordset.Fields("name").Value
Text7.Text = Data1.Recordset.Fields("bname").Value
Text4.Text = Data1.Recordset.Fields("author").Value

Text6.Text = Data1.Recordset.Fields("pub").Value
Text8.Text = Data1.Recordset.Fields("date").Value

Exit Do
Else
Data1.Recordset.MoveNext
End If
Loop

Dim id As Date
Dim rd As Date
id = Data1.Recordset.Fields("date").Value
rd = Date

44
x = Day(id)
y = Day(rd)

z=y-x
If z > 7 Then
Text9.Text = (z - 7) * 5
Else
Text9.Text = "0"
End If

End Sub

Private Sub Form_Activate()


If Data1.Recordset.BOF Then
MsgBox "No Books to Return ! !", vbOKOnly + vbInformation,
"Library System.."

Else

Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF
Combo1.AddItem (Data1.Recordset.Fields("bno").Value)
Data1.Recordset.MoveNext
Loop
End If

End Sub

Private Sub Form_Load()


Text5.Text = Date
Command1.Enabled = False

End Sub

45
Form6(treturn.frm)

Dim temp As Integer


Dim temp1 As Integer

Private Sub Combo1_Click()


temp = Val(Combo1.Text)

End Sub

Private Sub Command1_Click()


Dim tbn As String

Dim tauthor As String

Static ibb As Integer


Static rbb As Integer

Command1.Enabled = False

temp1 = temp

Data1.Recordset.AddNew
Data1.Recordset.Fields("cdate").Value = Date
Data1.Recordset.Fields("bn").Value = temp
Data1.Recordset.Fields("tname").Value = Text3.Text
Data1.Recordset.Fields("idate").Value = Text8.Text
Data1.Recordset.Fields("bname").Value = Text7.Text
Data1.Recordset.Fields("author") = Text4.Text
Data1.Recordset.Fields("pub") = Text6.Text
Data1.Recordset.Update
MsgBox "Book Returned", vbOKOnly + vbInformation, "Library
System.."

46
Data2.Recordset.MoveFirst
Do Until Data2.Recordset.EOF
If temp1 = Data2.Recordset.Fields("bn").Value Then

tbn = Data2.Recordset.Fields("bname").Value
tauthor = Data2.Recordset.Fields("author").Value

Data2.Recordset.Delete
Exit Do
Else
Data2.Recordset.MoveNext
End If

Loop
Combo1.Text = " "
Text3.Text = " "
Text4.Text = " "
Text6.Text = " "
Text7.Text = " "
Text8.Text = " "

Dim noc As Integer


Data3.Recordset.MoveFirst
Do Until Data3.Recordset.EOF
If tbn = Data3.Recordset.Fields("bname").Value And tauthor =
Data3.Recordset.Fields("author").Value Then
rbb = Data3.Recordset.Fields("rbook").Value
ibb = Data3.Recordset.Fields("ibook").Value
noc = Data3.Recordset.Fields("noc").Value
If rbb >= noc Then

47
MsgBox "Stock is Allready Complete", vbOKOnly + vbInformation,
"Library System.."
Else
rbb = rbb + 1
ibb = ibb - 1
End If
Data3.Recordset.Edit
Data3.Recordset.Fields("rbook").Value = rbb
Data3.Recordset.Fields("ibook").Value = ibb
Data3.Recordset.Update
Exit Do
Else
Data3.Recordset.MoveNext
End If
Loop

End Sub

Private Sub Command2_Click()


Command1.Enabled = True
Data2.Recordset.MoveFirst

Do Until Data2.Recordset.EOF
If temp = Data2.Recordset.Fields("bn").Value Then

Text3.Text = Data2.Recordset.Fields("tname").Value
Text8.Text = Data2.Recordset.Fields("idate").Value

Text7.Text = Data2.Recordset.Fields("bname").Value
Text4.Text = Data2.Recordset.Fields("author").Value

48
Text6.Text = Data2.Recordset.Fields("pub").Value

Exit Do
Else
Data2.Recordset.MoveNext
End If
Loop
End Sub

Private Sub Form_Activate()


If Data2.Recordset.BOF Then
MsgBox "No Books to Return ! !", vbOKOnly + vbInformation,
"Library System.."
Else

Data2.Recordset.MoveFirst
Do Until Data2.Recordset.EOF
Combo1.AddItem (Data2.Recordset.Fields("bn").Value)
Data2.Recordset.MoveNext

Loop

End If

End Sub

Private Sub Form_Load()


Text5.Text = Date
Command1.Enabled = False

End Sub

49
Form10(student.frm)

Dim bc As Integer
Private Sub Command1_Click()

If Text1 = Empty Then


MsgBox " You Have To Fill Student Name", vbInformation,
"Information"
Text1.SetFocus

Else

If Text4 = Empty Then


MsgBox " You Have To Fill Date of Birth", vbInformation,
"Information"
Text4.SetFocus

Else

If Text3 = Empty Then


MsgBox " You Have To Fill Father's Name", vbInformation,
"Information"
Text3.SetFocus

Else

If Text9 = Empty Then


MsgBox " You Have To Select Sex ", vbInformation, "Information"

Else

If Text5 = Empty Then


MsgBox "Dear You Have To Fill Occupataion", vbInformation,
"Information"

50
Text5.SetFocus

Else

If Text6 = Empty Then


MsgBox "You Have To Fill Address", vbInformation, "Information"
Text6.SetFocus

Else
If Text7 = Empty Then
MsgBox "You Have To Fill Phone Number", vbInformation,
"Information"
Text7.SetFocus

Else

If Text12 = Empty Then


MsgBox "You Have To Fill Semester", vbInformation, "Information"
Text12.SetFocus

Else

Data1.Recordset.Fields("adate").Value = Date
Data1.Recordset.Update
MsgBox "Student Added Successfully", vbOKOnly + vbInformation,
"Library System.."
Data1.Recordset.MoveFirst

Command2.Enabled = True
Command1.Enabled = False

End If
End If
End If
End If
End If
End If
End If

51
End If

End Sub

Private Sub Command10_Click()


Data1.Recordset.Delete
MsgBox "Record Deleted ! !", vbOKOnly + vbInformation, "Library
System.."
Data1.Recordset.MoveFirst

End Sub

Private Sub Command2_Click()


'Command1.Enabled = True
Command2.Enabled = False

Data1.Recordset.AddNew

Text1.Text = ""
Text4.Text = ""
Text3.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text12.Text = ""
Text1.SetFocus

bc = bc + 1

Text2.Text = bc

End Sub

Private Sub Command3_Click()


If Text9.Text = "M" Then

52
Option1(0).Value = True
Else
If Text9.Text = "F" Then
Option1(1).Value = True
End If
End If

Data1.Recordset.MoveFirst
End Sub

Private Sub Command4_Click()


If Text9.Text = "M" Then
Option1(0).Value = True
Else
If Text9.Text = "F" Then
Option1(1).Value = True
End If
End If

Data1.Recordset.MoveLast
End Sub

Private Sub Command5_Click()


If Data1.Recordset.EOF Then
MsgBox "Sorry Last Record", vbOKOnly + vbInformation, "Library
System.."
Data1.Recordset.MoveLast
Else

If Text9.Text = "M" Then


Option1(0).Value = True
Else
If Text9.Text = "F" Then

Option1(1).Value = True
End If

53
End If

Data1.Recordset.MoveNext
End If

End Sub

Private Sub Command6_Click()


If Data1.Recordset.BOF Then
MsgBox "Sorry First Record", vbOKOnly + vbInformation, "Library
System.."
Data1.Recordset.MoveFirst
Else

If Text9.Text = "M" Then


Option1(0).Value = True
Else
If Text9.Text = "F" Then
Option1(1).Value = True
End If
End If

Data1.Recordset.MovePrevious
End If

End Sub

Private Sub Command7_Click()


Dim S As Integer
Dim na As String
na = Text10.Text
S=0

54
Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF
If Trim(na) = Trim(Data1.Recordset.Fields("name").Value) Then
S=1
Exit Do
Else
Data1.Recordset.MoveNext
End If
Loop

If S = 0 Then
MsgBox "No Record Found", vbOKOnly + vbInformation, "Library
System.."
End If

End Sub

Private Sub Command8_Click()


Dim S As Integer
Dim na1 As String
na1 = Val(Text11.Text)
S=0

Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF
If Trim(na1) = Trim(Data1.Recordset.Fields("roll").Value) Then
S=1
Exit Do
Else
Data1.Recordset.MoveNext
End If
Loop

If S = 0 Then
MsgBox "No Record Found", vbOKOnly + vbInformation, "Library
System.."
End If

55
End Sub

Private Sub Command9_Click()

Data1.Recordset.Edit
Data1.Recordset.Update

End Sub

Private Sub Form_Activate()

Dim y As Integer
Dim y1 As String

Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF
y1 = Data1.Recordset.Fields("class").Value
y=0
For j = 0 To Combo1.ListCount - 1
If Trim(Combo1.List(j)) = Trim(y1) Then
y=1
End If
Next j
If y = 0 Then
Combo1.AddItem (y1)
End If
Data1.Recordset.MoveNext
Loop

Data1.Recordset.MoveLast
bc = Data1.Recordset.Fields("roll").Value
Text2.Text = bc

56
End Sub

Private Sub Form_Load()


Text8.Text = Date
Command1.Enabled = False

End Sub

Private Sub Form_Unload(Cancel As Integer)


Combo1.Clear

End Sub

Private Sub Option1_Click(Index As Integer)


If Option1(Index).Value = True Then
Text9.Text = Option1(Index).Caption
End If
End Sub

Private Sub Text12_LostFocus()


Command1.Enabled = True
End Sub

Form11(teacher.frm)

Dim bc1 As Integer

Private Sub Command1_Click()


Command1.Enabled = False
Command11.Enabled = True

57
Data1.Recordset.Fields("cdate").Value = Date
Data1.Recordset.Update
MsgBox "Teacher Added Successfully", vbOKOnly + vbInformation,
"Library System.."

Data1.Recordset.MoveFirst
End Sub

Private Sub Command10_Click()


Data1.Recordset.Delete
MsgBox "Record Deleted", vbOKOnly + vbInformation, "Library
System.."
Data1.Recordset.MoveFirst
End Sub

Private Sub Command11_Click()


'Command1.Enabled = True
Command11.Enabled = False

Data1.Recordset.AddNew

Text1.Text = " "


Text3.Text = " "
Text4.Text = " "
Text5.Text = " "
Text6.Text = " "
Text7.Text = " "
Text8.Text = 0
Text10.Text = " "
Text1.SetFocus

bc1 = bc1 + 1
Text2.Text = bc1

End Sub

58
Private Sub Command3_Click()
Data1.Recordset.MoveFirst

End Sub

Private Sub Command4_Click()


Data1.Recordset.MoveLast

End Sub

Private Sub Command5_Click()


If Data1.Recordset.EOF Then
MsgBox "Sorry Last Record", vbOKOnly + vbInformation, "Library
System.."
Data1.Recordset.MoveLast
Else
Data1.Recordset.MoveNext
End If
End Sub

Private Sub Command6_Click()


If Data1.Recordset.BOF Then
MsgBox "Sorry First Record", vbOKOnly + vbInformation, "Library
System.."
Data1.Recordset.MoveFirst
Else
Data1.Recordset.MovePrevious
End If

End Sub

Private Sub Command7_Click()


Dim S As Integer
Dim na As String
na = Text14.Text
S=0

59
Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF
If Trim(na) = Trim(Data1.Recordset.Fields("name").Value) Then
S=1
Exit Do
Else
Data1.Recordset.MoveNext
End If
Loop

If S = 0 Then
MsgBox "No Record Found", vbOKOnly + vbInformation, "Library
System.."
End If
End Sub

Private Sub Command8_Click()


Dim S As Integer
Dim na1 As String
na1 = Val(Text13.Text)
S=0

Data1.Recordset.MoveFirst
Do Until Data1.Recordset.EOF
If Trim(na1) = Trim(Data1.Recordset.Fields("id").Value) Then
S=1
Exit Do
Else
Data1.Recordset.MoveNext
End If
Loop

If S = 0 Then
MsgBox "No Record Found", vbOKOnly + vbInformation, "Library
System.."
End If
End Sub

60
Private Sub Form_Activate()
Data1.Recordset.MoveLast
bc1 = Data1.Recordset.Fields("id").Value
Text2.Text = bc1

End Sub

Private Sub Form_Load()


Text11.Text = Date
Command1.Enabled = False

End Sub

Private Sub Option1_Click(Index As Integer)


If Option1(Index).Value = True Then
Text9.Text = Option1(Index).Caption
End If

End Sub

Private Sub Option2_Click(Index As Integer)


If Option2(Index).Value = True Then
Text12.Text = Option2(Index).Caption
End If

End Sub

Private Sub Text10_LostFocus()


Command1.Enabled = True
End Sub

Form12(pass.frm)

61
Private Sub Command1_Click()
If Text1.Text = "ast" Or Text1.Text = "AST" Then
Form1.Show
Unload Me
Else
MsgBox "Wrong Password", vbOKOnly + vbInformation, "Library
System.."
Text1.Text = ""

Text1.SetFocus
End If

End Sub

Private Sub Command2_Click()


End
End Sub

Private Sub Form_Load()


Text1.Enabled = False
Command1.Enabled = False
Command2.Enabled = False
Image1.Visible = True

For i = 0 To 12
Label1(i).Visible = False
Next

End Sub

Private Sub Form_Unload(Cancel As Integer)


nam = Text2.Text
End Sub

62
Private Sub Timer1_Timer()
Static S As Integer

Label1(S).Visible = True
If S >= 12 Then
S=0

Text1.Enabled = True
'Text1.SetFocus
Command1.Enabled = True
Command2.Enabled = True

End If
S=S+1

End Sub

Form13(exit.frm)

Private Sub Form_Load()


Label2.Caption = nam
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()


End
End Sub

Form7(Senquiry.frm)

Private Sub Command1_Click()


CommonDialog1.ShowPrinter
End Sub

Form7(Tenquiry.frm)

63
Private Sub Command1_Click()
CommonDialog1.ShowPrinter
End Sub

Form9(Stock.frm)

Private Sub Command1_Click()


CommonDialog1.ShowPrinter
End Sub

Frmabout(frmabout.frm)

Private Sub Timer1_Timer()

Static AnimationStarter As Long


If AnimationStarter Mod 4 = 0 Then
frmabout.Cls
Dim i As Long
Dim a As Long

Select Case AnimationStarter


Case 0
For i = 0 To 255
frmabout.ForeColor = RGB(AnimationStarter * 10, i, i)
frmabout.CurrentX = 1300 - (3 * i)
frmabout.CurrentY = 1000 - (3 * i)
frmabout.Print "Library System"
For a = 1 To 10000
Next
Next
Case 4
For i = 0 To 255
64
frmabout.ForeColor = RGB(i, AnimationStarter * 10, i)
frmabout.CurrentX = 1300 - (3 * i)
frmabout.CurrentY = 1000 - (3 * i)
frmabout.Print "Library System"
For a = 1 To 10000
Next
Next
Case 8
For i = 0 To 255
frmabout.ForeColor = RGB(i, i, AnimationStarter * 10)
frmabout.CurrentX = 1300 - (3 * i)
frmabout.CurrentY = 1000 - (3 * i)
frmabout.Print "Library System"
For a = 1 To 10000
Next
Next
Case 12
For i = 0 To 255
frmabout.ForeColor = RGB(AnimationStarter * 10, AnimationStarter *
10, i)
frmabout.CurrentX = 1300 - (3 * i)

frmabout.CurrentY = 1000 - (3 * i)
frmabout.Print "Library System"
For a = 1 To 10000
Next
Next
Case 16
For i = 0 To 255
frmabout.ForeColor = RGB(AnimationStarter * 10, i, AnimationStarter *
10)
frmabout.CurrentX = 1300 - (3 * i)
frmabout.CurrentY = 1000 - (3 * i)
frmabout.Print "Library System"
For a = 1 To 10000
Next
Next

65
Case 20
For i = 0 To 255
frmabout.ForeColor = RGB(i, AnimationStarter * 10, AnimationStarter *
10)
frmabout.CurrentX = 1300 - (3 * i)
frmabout.CurrentY = 1000 - (3 * i)
frmabout.Print "Library System"
For a = 1 To 10000
Next
Next
AnimationStarter = -3

End Select

' black
frmabout.CurrentX = 1300 - (3 * i)
frmabout.CurrentY = 1000 - (3 * i)
frmabout.ForeColor = vbBlack
frmabout.Print "Library System"

End If

AnimationStarter = AnimationStarter + 1
End Sub

Private Sub Timer2_Timer()


Label2.ForeColor = RGB(Rnd() * 255, Rnd() * 255, Rnd() * 255)
Label3.ForeColor = RGB(Rnd() * 205, Rnd() * 25, Rnd() * 155)

Static S As Integer
If S Then
Label2.Visible = False
Else
Label2.Visible = True
End If
S = Not S

66
End Sub

Wel(wel.frm)

Private Sub Timer1_Timer()


Label1.ForeColor = RGB(Rnd() * 255, Rnd() * 255, Rnd() * 255)
End Sub

Private Sub Timer2_Timer()


Form12.Show
Unload Me

End Sub

Modules

Public bc As Integer
Public ib As Integer
Public rb As Integer
Public nam As String

Public tb1 as Integer

OUTPUT
67
OF

PROJECT

68
69
Password form

Main form

70
Add Student

71
72
Teacher Recruitment form

73
Adding new books form

74
Books Issuing form (Student)

75
Book Issuing form (teacher)

76
Book Returning form (Student)

77
Book Returning form (Teacher)

78
Issued Books Enquiry

79
Issued Books Enquiry

80
Library Stock Enquiry

81
Books Issuing form (Student)

82
CONCLUSION

In the end we come to conclusion that this project is very helpful for storing

and maintaining books record as well as student data. we can also use the

menu bar as well as toolbar to use various options. This project also provides

us the facility to search books using book name, author name as well as book
83
serial no. with the help of this project we can easily handle all the process of

library system.

Bibliography

1. Teach Yourself VB in 21 days by Gurewich (Tec media).

2. Teach Yourself More VB in 21 days by Days Maver (Tech

media).

84
85

You might also like