Sunteți pe pagina 1din 155

Project Report

Developed by:
Ashish H. Singh
Vinod R. Pendu

1
LIBRARY MANAGEMENT SYSTEM
FOR
DR. BABASAHEB AMBEDKAR LIBRARY

Submitted in Partial Fulfillment of Requirement for Degree of

BACHELOR OF SCIENCE – INFORMATION TECHNOLOGY


BY

Ashish H. Singh
Vinod R. Pendu

UNDER THE GUIDANCE OF


PROF: Mrs. Kiran Gurbani

BACHELOR OF SCIENCE – INFORMATION TECHNOLOGY

SAKET COLLEGE OF ARTS,SCIENCE & COMMERCE


KALYAN – 421306

AFFILIATED TO UNIVERSITY OF MUMBAI


ACADEMIC YEAR 2009-2010

2
DECLARATION
We hereby declare that the project entitled “Library Management System”,
submitted to the Mumbai University, Mumbai, in partial fulfillments of the
requirements of the award of the degree B.Sc.I.T. is a record of work done by the
team, under the guidance of Prof. Mrs. Kiran Gurbani, Department of
Information Technology, Saket College, Kalyan – 421306. The project has not
formed the base for the award of any Degree/Diploma/Association/Fellowship or
similar title to any University.

Team Members:

Ashish H. Singh
Vinod R. Pendu

3
CERTIFICATE
This is to certify that the project entitled “Library Management System”, submitted to the
Mumbai University, Mumbai, in partial fulfillments of the requirements of the award of the
degree B.Sc.IT is a record of original work done by the Ashish Singh & Vinod Pendu during
the period of their study in the Department of Information Technology, Saket College,
Kalyan-421306 under my supervision and guidance.The project has not formed the base for
the award of any Degree/Diploma/Association/Fellowship or similar title to any University.

Mrs. Kiran Gurbani

Internal Guide
Co-ordinator
Department of B.Sc.IT
Saket College
Kalyan-421306

4
ACKNOWLEDGEMENT
One of the great pleasures of writing this project book is acknowledging the efforts of
many people whose names may not appear on the cover but whose hard work, cooperation,
friendship and understanding were crucial to the preparation of this report on “Library
Management System”

We are very much thankful to Incharge of Dr. Babasaheb Ambedkar Library BNCMC,
who was kid enough to give us an opportunity to do this project work. Being our external
guide he imparted us immense administration, knowledge and provided us a clear back
ground about the problem scenario which helped us in laying a strong foundation to our
project.

It gives us pleasure in presenting this project book whose justification will never
sound good if we do not express our vote of thanks to all staff members of IT department of
our college for allowing us to work in the lab, without whose help our project and its thesis
would have neither begun nicely nor would have had reached the best ending.

We are much thankful to our project guide Mrs. Kiran Gurbani and all other teaching
and non teaching staff for their suggestion, reviews, encouraging, criticism and time to time
help & support which led us to achieve our goals and overcome the difficulties.

Last but not the least, we are thankful to our parents & friends who gave us the much
needed moral support and encouragement which made developing this project a work of
sheer joy and satisfaction. Thank you all once again.

5
PREFACE

This project has been accomplished through the help of advanced programming language.
The project will allow the users to keep record of members,book details and book
transactions etc. The aim of our project is to computerize almost all transactions of the
library. It has a colorful interface to keep it different from standard looking packages. The
report we are presenting is for the users who want to know about the function of the project
and how to operate the packet. It has combined the power of VB 6.0 with Microsoft Access
2003 to give the best desired results. We have strived to make this project as error free as
possible.

ASHISH SINGH
VINOD PENDU

6
CONTENTS

1. Introduction
Objective and Scope of Project
2. System Analysis
Gnatt Chart
Existing System
Requirement Analysis
Proposed System
Process Modeling
Data Modeling Analysis (ER Diagram)
System Concept for Process Modeling
Context Diagram
Data Flow Diagram
Structured chart
System Flowchart
Event Table
Decision Tree
3. System Design
System Design Approach
Data Base Design
Normalization
Table Structure
Menu Tree Diagram
Program List
Input Screen
Output Screen and Reports
4. System Implementation
System Testing
Change Over
Education and Training
How to operate our Project
Backup & Recovery
5. Conclusion
6. Future Enhancement
7
7. Bibliography
8. Source Code

SYNOPSIS

The aim of this project is to provide a software for “DR. BABASAHEB AMBEDKAR
LIBRARY” which provides the company a procedural approach for storing all his data
and records into a single data base. All the members details and books details are stored
and can be modified easily and very efficiently. The transactions done by the library are
also kept into the table and can be used whenever they need.

Various reports can be generated by using this software that can be used for further
transactions.

8
MINIMUM HARDWARE / SOFTWARE REQUIREMENT FOR OUR PROJECT

PROCESSOR : Intel P3 or above, AMD Turion 64


Technology

MEMORY : 128b of RAM or higher

MONITOR : CrystalBrite TFT LCD

HARD DISK : 4 GB or more

POINTER : Touch Pad

OTHERS : Printer

DISK DRIVE : CD ROM

FRONT END : Visual Basic 6.0

BACK END : Microsoft Access 2003

OPERATING SYSTEM: Windows XP

9
10
Objective of Project

This project is a package named Customer Interactive Program Package which


generates various reports for the organization.
To maintain information about books, library members, magazines, and to overcome
the limitations of the present manual system.

Following details are covered up by this project.

1. Maintain Book Details


2. Providing various services to the members
3. Generating various Reports when required

In this project all records are maintained in the form of table inside the database.
Calculations are done by the system . The system is user friendly i.e. no special knowledge is
required to handle this package. It is more reliable and one time investment which is very
profitable in the long run.

Advantages of proposed system over the old system:

 Proposed system will provide facilated access to information stored.

 It will also provide updating facility. Such as add, remove or modify the records.

 Each master table includes the facility for the record search.

 It will automatically produce different reports depending on information stored with


piece of information needed for particular type of reports.

 A very convenient Graphical User Interface (GUI) is provided by the proposed


System.

Scope of Project

The proposed system is computerized and all records are maintained in a database.
Book Details, Member Details, All Details can be checked whenever needed.
There is no need of special skills required to handle the package.
11
12
GNATT CHART

13
EXISTING SYSTEM

The current system is manually operated. All records are maintained in the register.
Every time an order is made it is entered into a register. The register can be checked for book
transaction. Thus numbers of registers are maintained. At the end of the day the manager
checks the daily report. All the reports and transaction collection are also stored in the
register.

Disadvantages of Existing System

1) All the transaction details are stored in register so we have to maintain number of
files, which is a big stuff.
2) All the records are entered by a manager so there is a chance of misentering of data.
3) Reports are generated by the manager and it is handwritten one.
4) As this is a manual system anyone can do anything so there is a chance of misusing
the data.
5) No security, anybody can access the details of member.

14
REQUIREMENT ANALYSIS

Definition:

Requirement analysis is the process of gathering and analysis user requirement. It is done
prior to starting the actual project development. it may be also be defined as a condition of
capabilities needed by the users to solve the problem or achieve an objective and also a
condition or capability that must be met or proposed by a system to satisfy a contract,
standard, specifications or other formal imposed documents.

Facts Finding Technique:

It is very important for the analyst to know the existing system and understand the
various needs of the end users , this is very important as to get the information regarding the
organization for which the project is to be made prior starting the project. The problems may
occur if there is a communication gap between the end user and the system analyst, that the
requirements are not properly conveyed.

The requirement analysis can be done by the system analyst by using various
techniques. The system analyst must be a skilled person; he should have good
communication capabilities. The project mainly depends on the requirement analysis which
is done by the system analyst.

15
PRECAUTION

The precautions which can be taken are given as follows:

I) On spot observation: The On spot observation gives many important clues


regarding the organization of the system. It highlights the problems and drawbacks
of the existing system. The problems regarding the data retrieval and data storage
and also loss of data are highlighted by doing on spot observations.
II) Interviewing: As we are concerned with the facts findings the interviewing is the
most important technique. By interviewing various peoples we can get a complete
view of the requirements and crosscheck whether the existing system is capable of
doing so.
III) Reviewing Records: Various documents such as the member details can be
studied.

These documents are studied for understanding the current methods of data
recording. This informs us about the actual data recorded.

16
VISUAL BASIC 6.0 AND MICROSOFT ACCESS

Visual basic 6.0 is selected because it is one of the leading rapid application development
tools available in the market for developing applications in the client/server environment.
VB 6.0 is more flexible, user friendly and easy to learn than its rivals like power builders,
Delphi, oracle, developer 2000 etc.

 VB 6.0 can be used by the network


 Modifications can be done faster and easier
 Access time is much lesser
 Does not require of VB to run the software
 Does not require on the application to manage the database.
 It can be used in many systems

The VB data manager allows VB users to create new database and examine or map the
structure of existing external database in variety of formats. Formats that you can either
create with Microsoft Access, so database create with VB or the data manager can be
manipulated using VB and Data manager.

17
PROPOSED SYSTEM

Following details are covered up by the proposed system

 Maintain book details


 Maintain member details
 Maintain magzines details
 Generating various reports when requested
 Generating daily/monthly reports when requested

Advantages of the proposed system


 All the records are stored inside the database which is Microsoft Access which
provides enhanced security option to the user.

 There is no need of maintaining the various files all the data are going to be stored at
one place and can be accessed easily.

 All the reports are generated by the computer so there is no chance of any kind of
missing or incomplete data

18
SYSTEM CONCEPT FOR DATA MODELLING

NOTATIONS USED IN DFDs

It represents the data flow

It represents Processing Nodes

It represents data store

It represents Entity

It represents process transaction

DATA MODELING AND ANALYSIS


A system module plays an important role in the system development. The data modeling is a
technique for defining business requirements for a database. Data modeling is sometimes
called as DATABASE MODELING because a data model is eventually implemented as a
database.

19
System Concept for a Data Modeling:

There are several notations for data modeling. The actual model is frequently called Entity
Relationship Diagram (ERD) because it depicts data in terms of the entities and
relationships described by the data. There are several notations for ERD’s. Most are named
after the inventor (e.g. IDEFIX.). These data modeling “languages” generally support the
same fundamental concepts and constructs. We have adopted the Martin (Information
Engineering) notation because of its widespread use and CASE tool support.

Entity Relationship Diagram (Model):

The Entity Relationship Diagram (Model) is based on perception of a real world that consists
of a collection of basic objects called as Entities and relationships among these objects.
Entities in database are described as set of attributes.

A Relationship is an association among several Entities.

The set of Entities of the same type are called as Entity Set.

The set of Relationships of same type are called as Relationship Set.

The ER – Diagram is built with the following components


.

 Rectangles which represents Entity Set.


 Ellipses which represents Attributes.
 Daimond, which represents Relationships.
 Lines, which represents Link
 Double ellipse which represents multivalve attributes
 Dashed ellipse, which represents derived attributes.
 Double line, which represents total participation of an entity in a relationship set

20
Notations used in E-R diagram

It represents entity set

It represents attributes.

It represents primary key attributes.

It represents relationship set.

Lines attribute to entity sets and entity sets to relationship sets.

21
ER- DIAGRAM:

22
CONTEXT LEVEL DIAGRAM

23
DFD
Data Flow Diagram
Member Member master
1.0
Staff
Masters Book Master
Book

Employee master
Magzine

Purchase
2.0 of Book Master
Publisher
books
Purchase of
books Purchase transaction
Management

Employee Purchase
3.0 of Book Master
books
Member Transaction
Book Transaction

Book

Member

Member Master
Employee 4.0
Reports Book Transaction
Book

Management

24
Book Master
Member

Member Master
Employee 4.1
Daily Reports Book Transaction
Book

Management

Member Book Master

4.2 Member Master


Employee
Monthly
Reports Book Transaction
Book
Magzine
Management

Magzine

25
STRUCTURE CHART:

Library System

Book Acquisition Book Search Book Circulation Member Subscription


Program Program Program Program

Issue/Re Return
serve Book
Maintain Book
Book Maintain
Information Display Book Member
Details Information

Validate Update
Book/Borr Member
ower ID Details
Update Update Get
Get Book Book Detail Book Member Validate
Detail Record Details Member
Details
Validate Update
Validate Book/Borro Book
Book wer ID Record
Details

26
SYSTEM FLOWCHART

27
Event Table

EVENT TRIGGER SOURCE ACTIVITY RESPONSE DESTINATIO


N
Librarian Librarian Look up Access Librarian
enters Login username and granted
username and reques password /
password t Access denied
Librarian Login Librarian Update Login Confirmation Librarian
change Yes : Update
request No : Cancel
Librarian New Book Librarian Add/Update Book details Librarian
adds /updates Book details
book details
Librarian New Member Add/Update Membership Librarian/
adds /updates member Member details Member
students details details
Librarian New Member Add/Update Membership Librarian/
adds /updates member Member details Member
staff details details
Member issues Request for Member Update status/
book book Issue details
of book
Member Request to Member Update status/
returns book return return details
of book
Member wants Book Member Search for Search results Member
to search for a Search book
book
Time to “End Of Produce Transaction Librarian
produce Day” transaction summery
transaction summery reports
summery reports
report
Librarian wants Over due Librarian Produce list of Overdue Librarian
to view books overdue books report
overdue books inquiry books

Librarian wants Book details Librarian Produce Book Book details Librarian
to view book request details
details
Librarian wants Request for Generate Display Librarian
to view borrower Librarian borrower borrower
28
member report report report
information
reports
Librarian wants Request for Generate Display book Librarian
to view books book report Librarian Book Report report
information
report Name
wise /accession
number

29
DECISION TREE:
Process 1

Login request data flow librarian

Yes Login librarian


Username and
Password is valid
No
Display “Login failed”

Process 2

Login change request dada flow from librarian

Accept new username/password


Yes Store new username /password
Old username/password
Entered is valid No
Display “Enter correct password”

Process 3

New book dada flow from librarian


Display “Book Already
Exists”
Yes
Check if Book
Yes Already Exist
Book details are valid No Add /Update details

No

Display “Enter valid details”

30
Process 4

New membership dada from librarian

Add /Update member details


Yes
Member details are
Valid No
Display “Enter valid details”

Process 5

Issue book dada flow from member

Update status/issue details of


book

Yes
Check if the book for
Specified member
No

Check if book is Yes Display”Book


is not for
Specified
Yes available member”
No
Check if Display “Book is not available”
Member already
Been issued a
Book No

Display “Book can not be issued”

31
Process 6

Return book data from flow member

Update status/return
Details of book

Check if Yes
Book
Is returned
On time
Update status /
No Return details
Yes Of book

Check if member has


Paid the fine
No
Add the member
In the defaulter list

Process 7

Book search data flow from member

Display search results


Check if search Yes
Criteria and data
Yields positive
Search results No
Display “No search results”

Process 8

Production of transaction summery report

Produce transaction summery report


Yes
If “End of day”

32
Process 9

Overdue Books inquiry data flow from librarian

Display overdue books report


Yes
Check if overdue
Books exist
No
Display “No overdue books”

Process 10

Borrower details request data flow from librarian

Yes Display currently issued books by borrower


Check if borrower
Details exist
No Display “You have not issued/reserved any book”

Process 11

Borrower report request data flow from librarian

Display Borrower report

If librarian request Yes


To view borrower
report

Process 12

Help request data flow from librarian

Display Help
Yes
Check if help
Available on
Desired topic No

Display “No help available on desired topic”

33
34
SYSTEM DESIGN

DESIGN METHODOLOGY

The software design can be classified into two types:

 Process Oriented System


 Data Oriented System

Process Oriented Systems are driven by their functionality. In this system it is


the process that is complicated. The data is not critical. Data oriented systems are
those that are driven by their concentration of data. In these systems it is the data that
is critical, not the process to handle it.

There are several methodologies that software engineers follow for


development of software. The Yourd Orr, DeMacro and gane-Sarson methodologies
are best for process oriented systems. These methodologies follow the structured
design approach. Structured analysis is a process of defining the requirements for the
problem. During analysis software engineers examine the needs of the user, and
define the properties that should proceed to meet those needs. They also identify the
system constraints and performance requirements.

Structured design is the process of planning how the system will be built, i.e.,
determining the procedures and data components needed and how these components
will be assembled to arrive at the solution. The system specifications, the problem
requirements and constraints defined in the analysis phase are used as input for the
design phase. The Warnier_orr, Jackson’s data and Martines information engineering
methodologies are for data oriented systems. In the data oriented approach, the data
structures are defined and the procedural components are derived from data structures.

35
DATABASE DESIGN

A database is a collection of files that work together to form a complete data management
system, we can even say a database is an organized collection of data. It can be looked upon
as files that contain tables, indexes and queries, a table is one data files, and the database is
the collection of those tables.

A table is a collection of data that can be represented as rows as columns. In database


terms, rows are called as records and columns are called as fields. The field available in a
database can be different types, note that files are attributes of records. Suppose you have a
book record, consider book as an object, the book object in library has different attributes
like book_id, title, author etc.

The following are some of the important fields of a database:

 Primary Key :

A primary key is one that uniquely identifies each record in a table such
as book_id in case of book records. A primary key is advisable in tables,
because it speeds up operations like searching, sorting and filtering.
Furthermore if you want to relate two tables together you must have a
primary key in one of the tables.

 Foreign Key :

A foreign key is one that helps to join two tables or link two tables. When
you define a column foreign key then you have to give the name of the
reference column of other tables you have to link this table to. With
foreign key whatever changes are made in the reference column are made
in the foreign column. Hence two tables are linked together using the
concept of primary key and foreign key. With foreign key, you can speed
up the operations like searching, sorting and filtering.

36
NORMALIZATION

Relationship between department in a company or between users and developers are


usually the product of particular historical circumstances which may define current relations
even though the circumstance have long since past. The result of this can be abnormal
relation or dysfunctional relations. Normalizations is the proceeds of putting things right,
making them normal. In a relational database the term also has specific mathematical
meaning having to do with separating elements of data into affinity groups, and defining the
normal relationship between them.

Normalization is commonly discussed in terms of FORM:

First Normal Form:

Putting data into first normal form is done by moving data into separate tables where
the data in each table is of the similar type, and giving each table a primary key a unique
label or identifier. This eliminates each group of data.

Second Normal Form:

It entails taking out data that only independent on the part of the key.

Third Normal Form:

It means getting rid of anything in the tables that does not depend solely on a primary
key. Anytime the data is on the third normal form, it is already in Second and First Normal
Forms.

Microsoft Access Language:

Microsoft Access Language is used for accessing relational database. With Microsoft
Access, we can Select, Insert, Update or Delete the records.

37
TABLE STRUCTURE

Book Master Table:


This table stores basic information about books; information stored in this table is
filled at the time of new book entry, data stored in this table are changed only when the table
is edited. Accessionno No. is a field which is defined as primary key and it stores the number
by which book is uniquely identified.

FIELD NAME DATA TYPE DESCRIPTION


Accessionno Number It shows the book no
BookName Text It shows the Name of book
Langusge Text It shows the language of book
Subject Text It shows the subject of book
Price Number It shows the price of book
Date Date/time It shows the date of entry
Pages Number It shows the no. of pages
Publication text It shows the publication of book
Yearofpublication Date/time It shows the year of publication of book
Author text It shows the name of author
Seller text It shows the name of seller
Edition text It shows the edition

Member Master Table

This table stores basic information about Members; information stored in this table is
filled at the time of new member entry, data stored in this table are changed only when the
table is edited. Member ID. is a field which is defined as primary key and it stores the
number by which member is uniquely identified.

FIELD DATA TYPE DESCRIPTION


NAME
Member_id number It shows the member id
38
Name Text It shows the name of member
Address text It shows the address of member
DOB Date/time It shows the date of birth of member
Status text It shows the current status of member
Dtaeofjoining Date/time It shows the date of joining
Fees number It shows the fees of memebr
MobileNo number It shows the contact no member
Gender text It shows the gender of member

Employee Master Table

This table stores basic information about Employee; information stored in this table is
filled at the time of new employee entry, data stored in this table are changed only when the
table is edited. Employee_id is a field which is defined as primary key and it stores the
number by which employee is uniquely identified.

FIELD DATA TYPE DESCRIPTION


NAME
Emp_id number It shows the employee id
Name Text It shows the name of the employee
Gender text It shows the gender of the employee
Address text It shows the address of the employee Magzine Master
DOB Date/time It Shows the DOB of employee Table
Qualification text It shows the qualification of employee
Mobileno number It shows the mobileno of employee This table
Dateofjoining Date/time It shows the dateofjoining of employee stores basic
Salary number It shows the salary of employee information about
Designation text It shows the designation of employee Magzines;
information stored
in this table is filled at the time of new magazine entry, data stored in this table are changed
only when the table is edited. Magzine ID. is a field which is defined as primary key and it
stores the number by which Magzine is uniquely identified.

FIELD DATA TYPE DESCRIPTION


NAME
Magzine_id number It shows the magazine id
Name Text It shows the name of magzine
Language Text It shows the language of magzine
Type text It shows the type of magazine
Noofcopies number It shows the number of copies

39
Date Date/time It shows the date of entry
Pages number It shows the no of pages
Editor text It shows the editor of magzine
Prize Number It shows the prize of one magzine
TotalPrize number It shows the total prize of magzine

Newspaper table

This table stores basic information about newspaper; information stored in this table is
filled at the time of new newspaper entry, data stored in this table are changed only when the
table is edited. NewspaperID is a field which is defined as primary key and it stores the
number by which newspaper is uniquely identified.

FIELD DATA TYPE DESCRIPTION


NAME
Newspaper_id number It shows the Newspaper id
Name Text It shows the name of Newspaper
Language Text It shows the language of Newspaper
Type text It shows the type of Newspaper
Noofcopies number It shows the number of copies
Date Date/time It shows the date of entry
Pages number It shows the no of pages
Editor text It shows the editor of Newspaper
Prize Number It shows the prize of one Newspaper
TotalPrize number It shows the total prize of Newspaper

Book Issue

This table stores the information about all the transaction performed. If book is issued
or returned to or from member then according changes are made to the table. Accession No.
is defined as a primary key, other information is stored about the employee or member by
which any employee can be uniquely identified. Issue Date and Return Date of the book is
stored for later library use. Also member no. of member is stored in the table.

FIELD NAME DATA TYPE DESCRIPTION


Member_id Number It shows the member id
Nameofmember Text It shows the name of member
Accessionno number It shows the Accessionno of book
40
Name text It shows the name of book
Issuedate Date/time It shows the date of issue
duedate Date/time It shows the duedate

Login Master Table

This table stores the password for administrator login and member login. It has two columns;
‘username’ and ‘password‘. The main thing to be noted is user name and password is
encrypted and encryption is performed at the front-end level.

FIELD NAME DATA TYPE DESCRIPTION


UserName text It shows the username
Password text It shows password

41
MENU TREE DIAGRAM:

42
PROGRAM LIST

Description - Form Name Used


Splash - Frmsplash
Login - Frmlogin
MDI - frmmdi
Global Information - frmglobalinfo
Create New User - Frmnewuser
Change Password - frmchangepassword
Book Master - Frmbook
Member Master - Frmmember
Employee Master - Frmemployee
Magzine Master - Frmmagzine
Newspaper Master - Frmnewspaper
Issue Book - frmissue
Return Book - frmreturn
Book report - frmbookreport
Report of Member - Frmmemberreport
Report of Employee - Frmemployeereport
Report of Magzine - Frmmagzinereport
Report of Newspaper frmnewsreport
Report of Issued book frmissuereport
About Us - Frmabout
Help - Frmhelp

43
SCREEN LAYOUT FOR EACH DATA ENTRY

SPLASH SCREEN:

44
CODE:

Private Sub Timer1_Timer()

PBar.Value = PBar.Value + 2
lbl1.Caption = PBar.Value & " % "
If PBar.Value = 100 Then
Timer1.Interval = 0
frmSplash.Hide
frmLogin.Show
End If
End Sub

45
LOGIN FORM:

46
CODE:

Dim rsuser As New ADODB.Recordset


Dim logincount As Integer
Private Sub cmdcancel_Click()
frmLogin.Hide
If MsgBox("Are you sure?, Do you want to CANCEL?", vbQuestion + vbYesNo,
"LIBRARY MANAGEMENT SYSTEM") = vbNo Then
frmLogin.Show
Else
End
End If
End Sub

Private Sub cmdok_Click()


txtUserName.SetFocus
logincount = logincount + 1
If logincount > 2 Then
MsgBox "Plz. Contact Administrator", vbCritical
End
End If
Set rsuser = New ADODB.Recordset
sqlq = "select * from Login where Username='" & txtUserName.Text & "' and Password='"
& txtPassword.Text & "'"
rsuser.Open sqlq, cn, adOpenDynamic, adLockOptimistic
If rsuser.EOF = True Then
MsgBox "Invalid user"
txtUserName.Text = " "
txtPassword.Text = " "
txtUserName.SetFocus
Else
'usertype = Login.("Password").Value
txtPassword.Text = rsuser.Fields("Password").Value
Unload Me
frmmdi.Show
End If

End Sub

47
MDI FORM

48
CODE:

Public str As String


Public a, b As Integer

Private Sub Create_Click()


frmnewuser.Show
End Sub

Private Sub MDIForm_Load()


Call conn
Me.WindowState = vbMaximized
End Sub

Private Sub mnuabout_Click()


frmInfo.Show
End Sub

Private Sub mnubook_Click()


frmbookreport.Show
End Sub

Private Sub mnubooks_Click()


frmbook.Show
End Sub

Private Sub mnucalculator_Click()


Shell "C:\WINDOWS\system32\calc.exe"
End Sub

Private Sub mnuemployee_Click()


frmemployee.Show
End Sub

Private Sub mnuemployeereport_Click()


frmemployeereport.Show
End Sub

Private Sub mnuexit_Click()


49
End
End Sub

Private Sub mnuglobalingo_Click()


frmglobalinfo.Show
End Sub

Private Sub mnuhome_Click()


frmissue.Show
End Sub

Private Sub mnuhelp_Click()


frmhelp.Show
End Sub

Private Sub mnuissue_Click()


frmissue.Show
End Sub

Private Sub mnuissuedbookreport_Click()


frmissuereport.Show
End Sub

Private Sub mnulib_Click()


frmissueforlib.Show
End Sub

Private Sub mnumagzine_Click()


frmmagzine.Show
End Sub

Private Sub mnumagzinereport_Click()


frmmagzinereport.Show
End Sub

Private Sub mnumember_Click()


frmMember.Show
End Sub

Private Sub mnumemberreport_Click()


frmmemberreport.Show
End Sub
50
Private Sub mnunews_Click()
frmnewspaperreport.Show
End Sub

Private Sub mnunewspaper_Click()


frmNewspaper.Show
Me.WindowState = vbMaximized
End Sub

Private Sub mnunotepad_Click()


On Error GoTo errHandle
Dim a As Double
a = Shell("c:\windows\notepad.exe", vbNormalFocus)
Exit Sub
errHandle:
MsgBox "Unable to run Notepad Utility on your computer", vbInformation, "Error in
opening!!!"
Resume Next
End Sub

Private Sub mnupass_Click()


frmchangepassword.Show
End Sub

Private Sub mnureturn_Click()


frmreturn.Show
End Sub

Private Sub munho_Click()


frmreturn.Show
End Sub

Private Sub Timer1_Timer()


StatusBar1.Panels(1).Text = Right(StatusBar1.Panels(1).Text,
Len(StatusBar1.Panels(1).Text) - 1) & Left(StatusBar1.Panels(1).Text, 1)
StatusBar1.Panels(4).Text = Right(StatusBar1.Panels(4).Text,
Len(StatusBar1.Panels(4).Text) - 1) & Left(StatusBar1.Panels(4).Text, 1)
End Sub

Private Sub Timer2_Timer()


51
Me.Caption = Left$(str, a + 1)
a=a+1
If a = b Then
a=0
End If
End Sub

52
BOOK MASTER

53
CODE:

Private rsbook As New ADODB.Recordset


Private Sub cboaccessionno_Click()
rsbook.MoveFirst
Do While Not rsbook.EOF() = True
If Val(cboaccessionno.Text) = rsbook.Fields("Accessionno").Value Then
'cboaccessionno.Text = rs.Fields("Accessionno").Value
'txtbookname.Text = rs.Fields("Bookname").Value
'cbolanguage.Text = rs.Fields("Language").Value
'txtsubject.Text = rs.Fields("Subject").Value
'txtdate.Text = rs.Fields("Date").Value
'txtprice.Text = rs.Fields("Price").Value
'txtpages.Text = rs.Fields("Pages").Value
'txtpublication.Text = rs.Fields("Publication").Value
'txtyearofpub.Text = rs.Fields("Yearofpublication").Value
'txtauthor.Text = rs.Fields("Author").Value
'txtseller.Text = rs.Fields("Seller").Value
Call showdata
Exit Sub
End If
rsbook.MoveNext
Loop
End Sub

Private Sub cmdadd_Click()


Dim a As Integer
Call txtunlock(Me)
Call txtblank(Me)
txtdate.Value = Date

rsbook.MoveLast
a = rsbook.Fields("accessionno").Value
a=a+1
cboaccessionno.Text = a
cmdadd.Enabled = False
cmdsave.Enabled = True
Call navdisable(Me)
54
cmdmodify.Enabled = False
cbolanguage.Enabled = True
cmdupdate.Enabled = False
cmddelete.Enabled = False
cmdcancel.Enabled = True
cboaccessionno.Locked = True
txtbookname.SetFocus
End Sub

Private Sub cmdcancel_Click()


Call txtblank(Me)
cmdcancel.Enabled = False
cmdadd.Enabled = True
cmdmodify.Enabled = True
cmdupdate.Enabled = False
cmdsave.Enabled = False
cmddelete.Enabled = True
rsbook.MoveFirst
Call showdata
Call navenable(Me)
End Sub

Private Sub cmddelete_Click()


s = MsgBox("Are yor sure you want to Delete the Records", vbYesNo)
If s = vbYes And rsbook.EOF = False And rsbook.BOF = False Then
rsbook.Delete
rsbook.MoveNext
MsgBox " Record deleted"
End If
If rsbook.EOF = True Then
rsbook.MovePrevious
End If
Call showdata
End Sub

Private Sub cmdexit_Click()


Unload Me
End Sub
Public Sub showdata()
cboaccessionno.Text = rsbook.Fields("accessionno").Value
txtbookname.Text = rsbook.Fields("Bookname").Value
cbolanguage.Text = rsbook.Fields("Language").Value
55
txtsubject.Text = rsbook.Fields("Subject").Value
txtdate.Value = rsbook.Fields("Date").Value
txtprice.Text = rsbook.Fields("Price").Value
txtpages.Text = rsbook.Fields("Pages").Value
txtpublication.Text = rsbook.Fields("Publication").Value
txtyearofpub.Text = rsbook.Fields("Yearofpublication").Value
txtedition.Text = rsbook.Fields("Edition").Value
txtauthor.Text = rsbook.Fields("Author").Value
txtseller.Text = rsbook.Fields("Seller").Value
End Sub
Private Sub cmdfirst_Click()
rsbook.MoveFirst
Call showdata
cmdfirst.Enabled = False
cmdlast.Enabled = True
cmdnext.Enabled = True
cmdprevious.Enabled = False
End Sub

Private Sub cmdlast_Click()


rsbook.MoveLast
Call showdata
cmdlast.Enabled = False
cmdfirst.Enabled = True
cmdnext.Enabled = False
cmdprevious.Enabled = True

End Sub

Private Sub cmdmodify_Click()


On Error Resume Next
cmdmodify.Enabled = False
cmdupdate.Enabled = True
Call navdisable(Me)
cmdcancel.Enabled = True
cmdadd.Enabled = False
cbolanguage.Enabled = True
cmddelete.Enabled = False
Call txtunlock(Me)
txtbookname.SetFocus
End Sub

56
Private Sub cmdnext_Click()
rsbook.MoveNext
If rsbook.EOF = True Then
rsbook.MoveLast
MsgBox "U R at the last record"
cmdnext.Enabled = False
cmdlast.Enabled = False
End If
showdata
cmdprevious.Enabled = True
cmdfirst.Enabled = True
End Sub

Private Sub cmdprevious_Click()


rsbook.MovePrevious
If rsbook.BOF = True Then
rsbook.MoveFirst
MsgBox "you are on the FIRST Record"
cmdprevious.Enabled = False
cmdfirst.Enabled = False
End If
showdata
cmdlast.Enabled = True
cmdnext.Enabled = True
End Sub

Private Sub cmdsave_Click()


If cboaccessionno.Text = " " Or txtbookname.Text = " " Or txtdate.Value = " " Or
txtprice.Text = " " Or txtauthor.Text = " " Or cbolanguage.Text = " " Or txtsubject.Text = ""
Or txtyearofpub.Text = " " Or txtpublication.Text = " " Or txtpages.Text = " " Or
txtseller.Text = " " Then
MsgBox "Please enter the value in all the field"
Call txtunlock(Me)
Else
rsbook.AddNew
rsbook.Fields("Accessionno").Value = Val(cboaccessionno.Text)
rsbook.Fields("Bookname").Value = Trim(txtbookname)
rsbook.Fields("Language").Value = Trim(cbolanguage.Text)
rsbook.Fields("Subject").Value = Trim(txtsubject.Text)
rsbook.Fields("Price").Value = Val(txtprice.Text)
rsbook.Fields("Date").Value = txtdate.Value
rsbook.Fields("Pages").Value = Val(txtpages.Text)
57
rsbook.Fields("Yearofpublication").Value = Val(txtyearofpub.Text)
rsbook.Fields("publication").Value = Trim(txtpublication.Text)
rsbook.Fields("Edition").Value = txtedition.Text
rsbook.Fields("Author").Value = Trim(txtauthor.Text)
rsbook.Fields("Seller").Value = Trim(txtseller.Text)
rsbook.Update
MsgBox "Records saved"
rsbook.MoveNext
End If
Call navenable(Me)
Call txtlock(Me)
cbolanguage.Enabled = True
cmddelete.Enabled = True
cmdsave.Enabled = False
cmdmodify.Enabled = True
cmdcancel.Enabled = False
End Sub
Private Sub cmdupdate_Click()
rsbook.Fields("accessionno").Value = Val(cboaccessionno.Text)
rsbook.Fields("Bookname").Value = Trim(txtbookname)
rsbook.Fields("Language").Value = Trim(cbolanguage.Text)
rsbook.Fields("Subject").Value = Trim(txtsubject.Text)
rsbook.Fields("Price").Value = Val(txtprice.Text)
rsbook.Fields("Date").Value = txtdate.Value
rsbook.Fields("Pages").Value = Val(txtpages.Text)
rsbook.Fields("Yearofpublication").Value = Val(txtyearofpub.Text)
rsbook.Fields("publication").Value = Trim(txtpublication.Text)
rsbook.Fields("Edition").Value = txtedition.Text
rsbook.Fields("Author").Value = Trim(txtauthor.Text)
rsbook.Fields("Seller").Value = Trim(txtseller.Text)
rsbook.Update
MsgBox "Records updated"
cmdadd.Enabled = True
cmdmodify.Enabled = True
cmddelete.Enabled = True
cmdupdate.Enabled = False
cmdcancel.Enabled = False
Call navenable(Me)
Call txtlock(Me)
End Sub

Private Sub cmdsearch_Click()


58
On Error GoTo err
If txtsearch.Text = " " Or cbosearch.Text = " " Then
MsgBox "Enter the value"
Exit Sub
End If
If cbosearch.Text = "Accession No." Then
If txtsearch.Text = " " Then
MsgBox "Enter the value"
Exit Sub
End If
rsbook.MoveFirst
While rsbook.EOF = False
If Val(txtsearch.Text) = Val(rsbook.Fields("accessionno").Value) Then
Call showdata
Exit Sub
Else
rsbook.MoveNext
End If
Wend
End If
If cbosearch.Text = "Book Name" Then
If txtsearch.Text = " " Then
MsgBox "Enter the value"
Exit Sub
End If
rsbook.MoveFirst
While rsbook.EOF = False
If UCase(txtsearch.Text) = UCase(rsbook.Fields("bookname").Value) Then
Call showdata
Exit Sub
Else
rsbook.MoveNext
End If
Wend
End If
err: MsgBox ("Record Not Found")
rsbook.MoveFirst
Call showdata
txtsearch.Text = ""
cbosearch.Text = ""
End Sub
Private Sub Form_Load()
59
Me.WindowState = vbMaximized
rsbook.Open "Book", cn, adOpenDynamic, adLockOptimistic
Call txtlock(frmbook)
rsbook.MoveFirst
Do While Not rsbook.EOF() = True
cboaccessionno.AddItem rsbook.Fields("AccessionNo").Value
rsbook.MoveNext
'Call showdata
Loop
cboaccessionno.Enabled = True
cmdnext.Enabled = True
cmdprevious.Enabled = False
cmdsave.Enabled = False
cmdcancel.Enabled = False

cmdupdate.Enabled = False
rsbook.MoveFirst
Call showdata
End Sub

Private Sub Form_Unload(Cancel As Integer)


If rsbook.State = adStateOpen Then
rsbook.Close
End If
End Sub

Private Sub txtauthor_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[A-Z]" And Not Chr(KeyAscii) Like "[a-z]" And Not KeyAscii
Like 32 And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter characters only!", vbOKOnly
End If
End Sub

Private Sub txtpages_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[0-9]" And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter NUMBERS only"
End If
End Sub

60
Private Sub txtprice_KeyPress(KeyAscii As Integer)
If Not Chr(KeyAscii) Like "[0-9]" And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter numbers only!", vbOKOnly
End If
End Sub
Private Sub txtpublication_KeyPress(KeyAscii As Integer)
If Not Chr(KeyAscii) Like "[A-Z]" And Not Chr(KeyAscii) Like "[a-z]" And Not KeyAscii
Like 32 And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter characters only!", vbOKOnly
End If
End Sub

Private Sub txtsubject_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[A-Z]" And Not Chr(KeyAscii) Like "[a-z]" And Not KeyAscii
Like 32 And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter characters only!", vbOKOnly
End If
End Sub

Private Sub txtseller_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[A-Z]" And Not Chr(KeyAscii) Like "[a-z]" And Not KeyAscii
Like 32 And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter characters only!", vbOKOnly
End If
End Sub

Private Sub txtyearofpub_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[0-9]" And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter numbers only!", vbOKOnly
End If
End Sub

61
MEMBER MASTER

62
CODE:

Private rsmember As New ADODB.Recordset

Private Sub cmdcancel_Click()


Call txtblank(Me)
cmdcancel.Enabled = False
cmdadd.Enabled = True
cmdmodify.Enabled = True
cmdupdate.Enabled = False
cmdsave.Enabled = False
cmddelete.Enabled = True
cmdsearch.Enabled = True
rsmember.MoveFirst
Call showdata
Call navenable(Me)
End Sub

Private Sub cmdexit_Click()


Unload Me
End Sub
Private Sub cmdsearch_Click()
On Error GoTo err
If txtsearch.Text = "" Or cbosearch.Text = "" Then
MsgBox "Enter the value"
Exit Sub
End If
If cbosearch.Text = "Member ID" Then
If txtsearch.Text = "" Then
MsgBox "Enter the value"
Exit Sub
End If
rsmember.MoveFirst
While rsmember.EOF = False
If Val(txtsearch.Text) = Val(rsmember.Fields("Memberid").Value) Then
Call showdata
Exit Sub
63
Else
rsmember.MoveNext
End If
Wend
End If
If cbosearch.Text = "Member Name" Then
If txtsearch.Text = "" Then
MsgBox "Enter the value"
Exit Sub
End If
rsmember.MoveFirst
While rsmember.EOF = False
If UCase(txtsearch.Text) = UCase(rsmember.Fields("Name").Value) Then
Call showdata
Exit Sub
Else
rsmember.MoveNext
End If
Wend
End If
err: MsgBox ("Record Not Found")
rsmember.MoveFirst
Call showdata
txtsearch.Text = ""
cbosearch.Text = ""

End Sub

Private Sub cbomemberid_click()


rsmember.MoveFirst
Do While Not rsmember.EOF() = True
If Val(cbomemberid.Text) = rsmember.Fields("Memberid").Value Then
Call showdata
Exit Sub
End If
rsmember.MoveNext
Loop

End Sub

Private Sub cmdfirst_Click()


rsmember.MoveFirst
64
Call showdata
cmdfirst.Enabled = False
cmdlast.Enabled = True
cmdnext.Enabled = True
cmdprevious.Enabled = False
End Sub

Private Sub cmddelete_Click()


s = MsgBox("Are yor sure you want to Delete the Records", vbYesNo)
If s = vbYes And rsmember.EOF = False And rsmember.BOF = False Then
rsmember.Delete
rsmember.MoveNext
MsgBox " Record deleted"
End If
If rsmember.EOF = True Then
rsmember.MovePrevious
End If
Call showdata
End Sub

Private Sub cmdprevious_Click()


rsmember.MovePrevious
If rsmember.BOF = True Then
rsmember.MoveFirst
MsgBox "you are on the FIRST Record"
cmdprevious.Enabled = False
cmdfirst.Enabled = False
End If
showdata
cmdlast.Enabled = True
cmdnext.Enabled = True
End Sub

Private Sub cmdnext_Click()


rsmember.MoveNext
If rsmember.EOF = True Then
rsmember.MoveLast
MsgBox "U R at the last record"
cmdnext.Enabled = False
cmdlast.Enabled = False
End If
showdata
65
cmdprevious.Enabled = True
cmdfirst.Enabled = True

End Sub

Private Sub cmdlast_Click()


rsmember.MoveLast
Call showdata
cmdlast.Enabled = False
cmdfirst.Enabled = True
cmdnext.Enabled = False
cmdprevious.Enabled = True
End Sub

Private Sub cmdadd_Click()


Dim a As Integer
Call txtunlock(Me)
Call txtblank(Me)
txtdate.Value = Date

rsmember.MoveLast
a = rsmember.Fields("Memberid").Value
a=a+1
cbomemberid.Text = a
cmdadd.Enabled = False
cmdsave.Enabled = True
Call navdisable(Me)
frmgender.Enabled = True
txtdob.Enabled = True

cbostatus.Enabled = True
cmdmodify.Enabled = False
cmdupdate.Enabled = False
cmddelete.Enabled = False
cmdcancel.Enabled = True
cmdsearch.Enabled = False
cbomemberid.Locked = True
optmale.Enabled = True
optfemale.Enabled = True
txtName.SetFocus
txtfee.Text = 105
txtfee.Locked = True
66
End Sub

Private Sub cmdmodify_Click()


cmdmodify.Enabled = False
cmdupdate.Enabled = True
Call navdisable(Me)
frmgender.Enabled = True
txtdob.Enabled = True
cbostatus.Enabled = True
cmdcancel.Enabled = True
cmdsave.Enabled = False
cmdsearch.Enabled = False
cmdadd.Enabled = False
cmddelete.Enabled = False
Call txtunlock(Me)
txtName.SetFocus
End Sub

Private Sub cmdsave_Click()


If cbomemberid.Text = " " Or txtName.Text = " " Or txtaddress.Text = " " Or txtmobno.Text
= "" Then
MsgBox "Please Enter all the fields properly"
Else
rsmember.AddNew
'On Error GoTo err
rsmember.Fields("memberid").Value = Val(cbomemberid.Text)
rsmember.Fields("Name").Value = Trim(txtName.Text)
rsmember.Fields("Address").Value = Trim(txtaddress.Text)
rsmember.Fields("mobileno").Value = txtmobno.Text
rsmember.Fields("status").Value = Trim(cbostatus.Text)
rsmember.Fields("fees").Value = Val(txtfee.Text)
rsmember.Fields("Dob").Value = txtdob.Value
rsmember.Fields("Dateofjoining").Value = txtdate.Value
If optmale.Value = True Then
rsmember.Fields("GENDER").Value = "Male"
Else
rsmember.Fields("GENDER").Value = "Female"
End If
rsmember.Update
MsgBox "Records saved"
rsmember.MoveNext
End If
67
Call navenable(Me)
Call txtlock(Me)
cmdsearch.Enabled = True
cmddelete.Enabled = True
cmdmodify.Enabled = True
cmdsave.Enabled = False
End Sub

Private Sub cmdupdate_Click()


rsmember.Fields("Memberid").Value = cbomemberid.Text
rsmember.Fields("Name").Value = Trim(txtName)
rsmember.Fields("Address").Value = Trim(txtaddress.Text)
rsmember.Fields("Dateofjoining").Value = txtdate.Value
If optmale.Value = True Then
rsmember.Fields("Gender").Value = "Male"
Else
rsmember.Fields("Gender").Value = "Female"
End If

If rsmember.Fields("Status").Value = "School" Then


cbostatus.Text = "School"
ElseIf rsmember.Fields("Status").Value = "College" Then
cbostatus.Text = "College"
Else
cbostatus.Text = "Other"
End If
rsmember.Fields("Dob").Value = txtdob.Value
rsmember.Fields("MobileNo").Value = txtmobno.Text
rsmember.Update
MsgBox "Records updated"
cmdadd.Enabled = True
cmdmodify.Enabled = True
cmddelete.Enabled = True
cmdupdate.Enabled = False
cmdsave.Enabled = False
cmdcancel.Enabled = False
cbostatus.Enabled = False
txtdob.Enabled = False
cmdsearch.Enabled = True
frmgender.Enabled = False
Call navenable(Me)
Call txtlock(Me)
68
End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
rsmember.Open "Member", cn, adOpenDynamic, adLockOptimistic
Call txtlock(frmMember)
'Call showdata
rsmember.MoveFirst
Do While Not rsmember.EOF() = True
cbomemberid.AddItem rsmember.Fields("Memberid").Value
rsmember.MoveNext
Loop
txtdob.Enabled = False
cbomemberid.Enabled = True
frmgender.Enabled = False
cbostatus.Enabled = False
cmdnext.Enabled = False
cmdprevious.Enabled = False
cmdsave.Enabled = False
cmdcancel.Enabled = False
cmdupdate.Enabled = False
txtfee.Text = 105
txtsearch.Locked = False
rsmember.MoveFirst
Call showdata

End Sub

Public Sub showdata()


cbomemberid.Text = rsmember.Fields("Memberid").Value
txtName.Text = rsmember.Fields("Name").Value
txtaddress.Text = rsmember.Fields("Address").Value
If rsmember.Fields("Gender").Value = "Female" Then
optfemale.Value = True
Else
optmale.Value = True
End If
If rsmember.Fields("Status").Value = "School" Then
cbostatus.Text = "School"
ElseIf rsmember.Fields("Status").Value = "College" Then
cbostatus.Text = "College"
69
Else
cbostatus.Text = "Other"
End If
txtdate.Value = rsmember.Fields("Dateofjoining").Value
txtdob.Value = rsmember.Fields("Dob").Value
txtmobno.Text = rsmember.Fields("Mobileno").Value
txtfee.Text = rsmember.Fields("Fees").Value
End Sub

Private Sub Form_Unload(Cancel As Integer)


If rsmember.State = adStateOpen Then
rsmember.Close
End If
End Sub

Private Sub txtmobno_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[0-9]" And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter NUMBERS only"
End If
End Sub

Private Sub txtname_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[A-Z]" And Not Chr(KeyAscii) Like "[a-z]" And Not KeyAscii
Like 32 And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter characters only!", vbOKOnly
End If
End Sub

70
EMPLOYEE MASTER

71
CODE:

Private rsemployee As New ADODB.Recordset

Private Sub cmdcancel_Click()


Call txtblank(Me)
cmdcancel.Enabled = False
cmdadd.Enabled = True
cmdmodify.Enabled = True
cmdupdate.Enabled = False
cmdsave.Enabled = False
cmddelete.Enabled = True
rsemployee.MoveFirst
Call showdata
Call navenable(Me)
End Sub

Private Sub cmdexit_Click()


Unload Me
End Sub
Private Sub cboempid_Click()
rsemployeeMoveFirst
Do While Not rsemployeeEOF() = True
If Val(cboempid.Text) = rsemployeeFields("Emp_id").Value Then
Call showdata
Exit Sub
End If
rsemployeeMoveNext
Loop
End Sub

Private Sub cmdadd_Click()


Dim a As Integer
Call txtunlock(Me)
Call txtblank(Me)

rsemployee.MoveLast
72
a = rsemployee.Fields("Emp_id").Value
a=a+1
cboempid.Text = a
cmdadd.Enabled = False
cmdsave.Enabled = True
Call navdisable(Me)
cmdmodify.Enabled = False
cmdupdate.Enabled = False
cmddelete.Enabled = False
cmdcancel.Enabled = True
cboempid.Locked = True
frmgender.Enabled = True
txtdob.Enabled = True
txtname.SetFocus
End Sub

Private Sub cmddelete_Click()


s = MsgBox("Are yor sure you want to Delete the Records", vbYesNo)
If s = vbYes And rsemployee.EOF = False And rsemployee.BOF = False Then
rsemployee.Delete
rsemployee.MoveNext
MsgBox " Record deleted"
End If
If rsemployee.EOF = True Then
rsemployee.MovePrevious
End If
Call showdata
End Sub

Private Sub cmdfirst_Click()


rsemployee.MoveFirst
Call showdata
cmdfirst.Enabled = False
cmdlast.Enabled = True
cmdnext.Enabled = True
cmdprevious.Enabled = False
End Sub

Private Sub cmdlast_Click()


73
rsemployee.MoveLast
Call showdata
cmdlast.Enabled = False
cmdfirst.Enabled = True
cmdnext.Enabled = False
cmdprevious.Enabled = True
End Sub

Private Sub cmdmodify_Click()


cmdmodify.Enabled = False
cmdupdate.Enabled = True
Call navdisable(Me)
cmdcancel.Enabled = True
cmdadd.Enabled = False
cmddelete.Enabled = False
Call txtunlock(Me)
frmgender.Enabled = True
txtdob.Enabled = True
txtname.SetFocus
End Sub

Private Sub cmdnext_Click()


rsemployee.MoveNext
If rsemployee.EOF = True Then
rsemployee.MoveLast
MsgBox "U R at the last record"
cmdnext.Enabled = False
cmdlast.Enabled = False
End If
showdata
cmdprevious.Enabled = True
cmdfirst.Enabled = True
End Sub

Private Sub cmdprevious_Click()


rsemployee.MovePrevious
If rsemployee.BOF = True Then
rsemployee.MoveFirst
MsgBox "you are on the FIRST Record"
cmdprevious.Enabled = False
cmdfirst.Enabled = False
End If
74
showdata
cmdlast.Enabled = True
cmdnext.Enabled = True
End Sub

Private Sub cmdsave_Click()


If cboempid.Text = " " Or txtname.Text = " " Or txtaddress.Text = " " Or txtmobno.Text = " "
Or txtsalary.Text = " " Or txtquali.Text = " " Then
MsgBox "Please Enter all the fields properly"
Else
rsemployee.AddNew
'On Error GoTo err
rsemployee.Fields("Emp_id").Value = Val(cboempid.Text)
rsemployee.Fields("Name").Value = Trim(txtname.Text)
rsemployee.Fields("Address").Value = Trim(txtaddress.Text)
rsemployee.Fields("mobileno").Value = Trim(txtmobno.Text)
rsemployee.Fields("Designation").Value = Trim(txtdesignation.Text)
rsemployee.Fields("Qualification").Value = Trim(txtquali.Text)
rsemployee.Fields("Dob").Value = txtdob.Value
rsemployee.Fields("Dateofjoining").Value = txtdate.Value
rsemployee.Fields("Salary").Value = Trim(txtsalary.Text)
If optmale.Value = True Then
rsemployee.Fields("GENDER").Value = "male"
ElseIf optfemale.Value = True Then
rsemployee.Fields("GENDER").Value = "female"
End If

rsemployee.Update
MsgBox "Records saved"
rsemployee.MoveNext
End If
Call navenable(Me)
Call txtlock(Me)
cmddelete.Enabled = True
cmdsave.Enabled = False
cmdmodify.Enabled = True
End Sub

Private Sub cmdsearch_Click()


On Error GoTo err
If txtsearch.Text = "" Or cbosearch.Text = "" Then
MsgBox "Enter the value"
75
Exit Sub
End If
If cbosearch.Text = "Employee ID" Then
If txtsearch.Text = "" Then
MsgBox "Enter the value"
Exit Sub
End If
rsemployee.MoveFirst
While rsemployee.EOF = False
If Val(txtsearch.Text) = Val(rsemployee.Fields("Emp_id").Value) Then
Call showdata
Exit Sub
Else
rsemployee.MoveNext
End If
Wend
End If
If cbosearch.Text = "Employee Name" Then
If txtsearch.Text = "" Then
MsgBox "Enter the value"
Exit Sub
End If
rsemployee.MoveFirst
While rsemployee.EOF = False
If UCase(txtsearch.Text) = UCase(rsemployee.Fields("Name").Value) Then
Call showdata
Exit Sub
Else
rsemployee.MoveNext
End If
Wend
End If
err: MsgBox ("Record Not Found")
rsemployee.MoveFirst
Call showdata
txtsearch.Text = ""
cbosearch.Text = ""
End Sub

Private Sub cmdupdate_Click()


rsemployee.Fields("Emp_id").Value = Val(cboempid.Text)
rsemployee.Fields("Name").Value = Trim(txtname)
76
rsemployee.Fields("Address").Value = Trim(txtaddress.Text)
rsemployee.Fields("Dateofjoining").Value = txtdate.Value
rsemployee.Fields("Designation").Value = txtdesignation
rsemployee.Fields("Dob").Value = txtdob.Value
rsemployee.Fields("Qualification").Value = txtquali.Text
rsemployee.Fields("Mobileno").Value = txtmobno.Text
rsemployee.Fields("Salary").Value = txtsalary.Text
If optmale.Value = True Then
rsemployee.Fields("Gender").Value = "Male"
Else
rsemployee.Fields("Gender").Value = "Female"
End If
rsemployee.Update
MsgBox "Records updated"
cmdadd.Enabled = True
cmdmodify.Enabled = True
cmddelete.Enabled = True
cmdupdate.Enabled = False
cmdcancel.Enabled = False
Call navenable(Me)
Call txtlock(Me)
End Sub

Private Sub Command1_Click()


Unload Me
End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
rsemployee.Open "Employee", cn, adOpenDynamic, adLockOptimistic
Call txtlock(frmemployee)
rsemployee.MoveFirst
Do While Not rsemployee.EOF() = True
cboempid.AddItem rsemployee.Fields("Emp_id").Value
rsemployee.MoveNext
Loop

cmdnext.Enabled = False
cmdprevious.Enabled = False
cmdsave.Enabled = False
cmdcancel.Enabled = False
cmdupdate.Enabled = False
77
txtsearch.Locked = False
frmgender.Enabled = False
txtdob.Enabled = False
rsemployee.MoveFirst
Call showdata
End Sub
Public Sub showdata()
cboempid.Text = rsemployee.Fields("Emp_id").Value
txtname.Text = rsemployee.Fields("Name").Value
txtaddress.Text = rsemployee.Fields("Address").Value
If rsemployee.Fields("Gender").Value = "Female" Then
optfemale.Value = True
Else
optmale.Value = True
End If
txtdate.Value = rsemployee.Fields("Dateofjoining").Value
txtdesignation.Text = rsemployee.Fields("Designation").Value
txtdob.Value = rsemployee.Fields("Dob").Value
txtquali.Text = rsemployee.Fields("Qualification").Value
txtmobno.Text = rsemployee.Fields("Mobileno").Value
txtsalary.Text = rsemployee.Fields("Salary").Value

End Sub

Private Sub Form_Unload(Cancel As Integer)


If rsemployee.State = adStateOpen Then
rsemployee.Close
End If
End Sub

Private Sub txtdesignation_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[A-Z]" And Not Chr(KeyAscii) Like "[a-z]" And Not KeyAscii
Like 32 And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter characters only!", vbOKOnly
End If
End Sub

Private Sub txtmobno_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[0-9]" And Not KeyAscii Like 8 Then
78
KeyAscii = 0
MsgBox "Enter NUMBERS only"
End If
End Sub

Private Sub txtname_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[A-Z]" And Not Chr(KeyAscii) Like "[a-z]" And Not KeyAscii
Like 32 And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter characters only!", vbOKOnly
End If
End Sub

Private Sub txtsalary_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[0-9]" And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter NUMBERS only"
End If
End Sub

79
MAGZINE MASTER

80
CODE:

Private rsmagzine As New ADODB.Recordset


Private Sub cbomagid_Click()
rsmagzine.MoveFirst
Do While Not rsmagzine.EOF() = True
If Val(cbomagid.Text) = rsmagzine.Fields("Magzine_id").Value Then
Call showdata
Exit Sub
End If
rsmagzine.MoveNext
Loop
End Sub

Private Sub cmdadd_Click()


Dim a As Integer
Call txtunlock(Me)
Call txtblank(Me)

rsmagzine.MoveLast
a = rsmagzine.Fields("Magzine_id").Value
a=a+1
cbomagid.Text = a
cmdadd.Enabled = False
cmdsave.Enabled = True
Call navdisable(Me)
txttotalprize.Locked = True
cbotype.Enabled = True
cbolanguage.Enabled = True
cmdmodi.Enabled = False
cmdupdate.Enabled = False
cmddelete.Enabled = False
cmdcancel.Enabled = True
cbomagid.Locked = True
cmdsearch.Enabled = False
81
txtname.SetFocus
End Sub

Private Sub cmdcancel_Click()


Call txtblank(Me)
cmdcancel.Enabled = False
cmdadd.Enabled = True
cmdmodi.Enabled = True
cmdupdate.Enabled = False
cmdsave.Enabled = False
cmddelete.Enabled = True
rsmagzine.MoveFirst
Call showdata
Call navenable(Me)
End Sub

Private Sub cmddelete_Click()


s = MsgBox("Are yor sure you want to Delete the Records", vbYesNo)
If s = vbYes And rsmagzine.EOF = False And rsmagzine.BOF = False Then
rsmagzine.Delete
rsmagzine.MoveNext
MsgBox " Record deleted"
End If
If rsmagzine.EOF = True Then
rsmagzine.MovePrevious
End If
Call showdata
End Sub

Private Sub cmdexit_Click()


Unload Me
End Sub

Private Sub cmdfirst_Click()


rsmagzine.MoveFirst
Call showdata
cmdfirst.Enabled = False
cmdlast.Enabled = True
cmdnext.Enabled = True
cmdprevious.Enabled = False
End Sub

82
Private Sub cmdlast_Click()
rsmagzine.MoveLast
Call showdata
cmdlast.Enabled = True
cmdfirst.Enabled = True
cmdnext.Enabled = False
cmdprevious.Enabled = True
cmdlast.Enabled = False
End Sub

Private Sub cmdmodi_Click()


cmdmodi.Enabled = False
cmdupdate.Enabled = True
Call navdisable(Me)
cbotype.Enabled = True
cbolanguage.Enabled = True
cmdcancel.Enabled = True
cmdadd.Enabled = False
cmddelete.Enabled = False
cmdsearch.Enabled = False
Call txtunlock(Me)
txtname.SetFocus
End Sub
Private Sub cmdnext_Click()
rsmagzine.MoveNext
If rsmagzine.EOF = True Then
rsmagzine.MoveLast
MsgBox "U R at the last record"
cmdnext.Enabled = False
cmdlast.Enabled = False
End If
showdata
cmdprevious.Enabled = True
cmdfirst.Enabled = True

End Sub

Private Sub cmdprevious_Click()


rsmagzine.MovePrevious
If rsmagzine.BOF = True Then
rsmagzine.MoveFirst
83
MsgBox "you are on the FIRST Record"
cmdprevious.Enabled = False
cmdfirst.Enabled = False
End If
showdata
cmdlast.Enabled = True
cmdnext.Enabled = True
End Sub

Private Sub cmdsave_Click()


If cbomagid.Text = " " Or txtname.Text = " " Or txtprize.Text = " " Or txteditor.Text = " " Or
cbolanguage.Text = " " Or cbotype.Text = " " Or txtpages.Text = " " Then
MsgBox "Please enter the value in all the field"
Else
rsmagzine.AddNew
rsmagzine.Fields("Magzine_id").Value = Val(cbomagid.Text)
rsmagzine.Fields("Name").Value = Trim(txtname)
rsmagzine.Fields("Language").Value = cbolanguage.Text
rsmagzine.Fields("Type").Value = Trim(cbotype.Text)
rsmagzine.Fields("Prize").Value = Val(txtprize.Text)
rsmagzine.Fields("Date").Value = txtdate.Value
rsmagzine.Fields("Pages").Value = Val(txtpages.Text)
rsmagzine.Fields("Noofcopies").Value = Val(txtcopies.Text)
rsmagzine.Fields("Editor").Value = Trim(txteditor.Text)
rsmagzine.Fields("Totalprize").Value = Val(txttotalprize.Text)
rsmagzine.Update
MsgBox "Records saved"
rsmagzine.MoveNext
End If
Call navenable(Me)
Call txtlock(Me)
cmddelete.Enabled = True
cmdsearch.Enabled = True
cmdsave.Enabled = False
End Sub

Private Sub cmdsearch_Click()


On Error GoTo err
If txtsearch.Text = "" Or cbosearch.Text = "" Then
MsgBox "Enter the value"
Exit Sub
End If
84
If cbosearch.Text = "Magzine ID" Then
If txtsearch.Text = "" Then
MsgBox "Enter the value"
Exit Sub
End If
rsmagzine.MoveFirst
While rsmagzine.EOF = False
If Val(txtsearch.Text) = Val(rsmagzine.Fields("Magzine_id").Value) Then
Call showdata
Exit Sub
Else
rsmagzine.MoveNext
End If
Wend
End If
If cbosearch.Text = "Magzine Name" Then
If txtsearch.Text = "" Then
MsgBox "Enter the value"
Exit Sub
End If
rsmagzine.MoveFirst
While rsmagzine.EOF = False
If UCase(txtsearch.Text) = UCase(rsmagzine.Fields("Name").Value) Then
Call showdata
Exit Sub
Else
rsmagzine.MoveNext
End If
Wend
End If
err: MsgBox ("Record Not Found")
rsmagzine.MoveFirst
Call showdata
txtsearch.Text = ""
cbosearch.Text = ""
End Sub

Private Sub cmdupdate_Click()


rsmagzine.Fields("Magzine_id").Value = Val(cbomagid.Text)
rsmagzine.Fields("Name").Value = Trim(txtname)
rsmagzine.Fields("Language").Value = cbolanguage.Text
rsmagzine.Fields("Type").Value = Trim(cbotype.Text)
85
rsmagzine.Fields("Prize").Value = Val(txtprize.Text)
rsmagzine.Fields("Date").Value = txtdate.Value
rsmagzine.Fields("Pages").Value = Val(txtpages.Text)
rsmagzine.Fields("Noofcopies").Value = Val(txtcopies.Text)
rsmagzine.Fields("Editor").Value = Trim(txteditor.Text)
rsmagzine.Fields("Totalprize").Value = Val(txttotalprize.Text)
rsmagzine.Update
MsgBox "Records updated"
cmdadd.Enabled = True
cmdmodi.Enabled = True
cmddelete.Enabled = True
cmdupdate.Enabled = False
cmdcancel.Enabled = False
cmdsearch.Enabled = True
Call navenable(Me)
Call txtlock(Me)
End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
rsmagzine.Open "Magzine", cn, adOpenDynamic, adLockOptimistic
Call txtlock(frmmagzine)

rsmagzine.MoveFirst
Do While Not rsmagzine.EOF() = True
cbomagid.AddItem rsmagzine.Fields("Magzine_id").Value
rsmagzine.MoveNext
Loop
txttotalprize.Locked = True
cbotype.Enabled = False
cbolanguage.Enabled = False
cbomagid.Enabled = True
cmdnext.Enabled = False
cmdprevious.Enabled = False
cmdsave.Enabled = False
cmdupdate.Enabled = False
cmdcancel.Enabled = False
txtsearch.Locked = False
rsmagzine.MoveFirst
Call showdata
End Sub

86
Public Sub showdata()

cbomagid.Text = rsmagzine.Fields("Magzine_id").Value
txtname.Text = rsmagzine.Fields("Name").Value
cbolanguage.Text = rsmagzine.Fields("Language").Value
cbotype.Text = rsmagzine.Fields("Type").Value
txtdate.Value = rsmagzine.Fields("Date").Value
txtpages.Text = rsmagzine.Fields("Pages").Value
txtcopies.Text = rsmagzine.Fields("Noofcopies").Value
txteditor.Text = rsmagzine.Fields("Editor").Value
txtprize.Text = rsmagzine.Fields("Prize").Value
txttotalprize.Text = rsmagzine.Fields("Totalprize").Value
End Sub

Private Sub Form_Unload(Cancel As Integer)


If rsmagzine.State = adStateOpen Then
rsmagzine.Close
End If
End Sub

Private Sub txtcopies_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[0-9]" And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter NUMBERS only"
End If
End Sub

Private Sub txteditor_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[A-Z]" And Not Chr(KeyAscii) Like "[a-z]" And Not KeyAscii
Like 32 And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter characters only!", vbOKOnly
End If
End Sub

Private Sub txtname_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[A-Z]" And Not Chr(KeyAscii) Like "[a-z]" And Not KeyAscii
Like 32 And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter characters only!", vbOKOnly
End If
End Sub
87
Private Sub txtpages_KeyPress(KeyAscii As Integer)
If Not Chr(KeyAscii) Like "[0-9]" And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter NUMBERS only"
End If
End Sub

Private Sub txtprize_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[0-9]" And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter NUMBERS only"
End If
End Sub

Private Sub txtprize_LostFocus()


txttotalprize.Text = txtcopies * txtprize
End Sub

88
NEWSPAPER MASTER

89
CODE:
Private rsnewspaper As New ADODB.Recordset
Private Sub cbonewsid_Click()
rsnewspaper.MoveFirst
Do While Not rsnewspaper.EOF() = True
If Val(cbonewsid.Text) = rsnewspaper.Fields("Newspaper_id").Value Then
Call showdata
Exit Sub
End If
rsnewspaper.MoveNext
Loop
End Sub

Private Sub cmdadd_Click()


Dim a As Integer
Call txtunlock(Me)
Call txtblank(Me)

rsnewspaper.MoveLast
a = rsnewspaper.Fields("Newspaper_id").Value
a=a+1
cbonewsid.Text = a
cmdadd.Enabled = False
cmdsave.Enabled = True
Call navdisable(Me)
cbolanguage.Enabled = True
cmdmodi.Enabled = False
cmdupdate.Enabled = False
cmddelete.Enabled = False
cmdcancel.Enabled = True
cbonewsid.Locked = True
txtname.SetFocus
End Sub

Private Sub cmdcancel_Click()


Call txtblank(Me)
cmdcancel.Enabled = False
cmdadd.Enabled = True
90
cmdmodi.Enabled = True
cmdupdate.Enabled = False
cmdsave.Enabled = False
cmddelete.Enabled = True
rsnewspaper.MoveFirst
Call showdata
Call navenable(Me)
End Sub

Private Sub cmddelete_Click()


s = MsgBox("Are yor sure you want to Delete the Records", vbYesNo)
If s = vbYes And rsnewspaper.EOF = False And rsnewspaper.BOF = False Then
rsnewspaper.Delete
rsnewspaper.MoveNext
MsgBox " Record deleted"
End If
If rsnewspaper.EOF = True Then
rsnewspaper.MovePrevious
End If
Call showdata
End Sub

Private Sub cmdexit_Click()


Unload Me
End Sub

Private Sub cmdfirst_Click()


rsnewspaper.MoveFirst
Call showdata
cmdfirst.Enabled = False
cmdlast.Enabled = True
cmdnext.Enabled = True
cmdprevious.Enabled = False
End Sub

Private Sub cmdlast_Click()


rsnewspaper.MoveLast
Call showdata
cmdlast.Enabled = True
cmdfirst.Enabled = True
cmdnext.Enabled = False
cmdprevious.Enabled = True
91
cmdlast.Enabled = False
End Sub

Private Sub cmdmodi_Click()


cmdmodi.Enabled = False
cmdupdate.Enabled = True
Call navdisable(Me)
cbolanguage.Enabled = True
cmdcancel.Enabled = True
cmdadd.Enabled = False
cmddelete.Enabled = False
Call txtunlock(Me)
txtname.SetFocus
End Sub

Private Sub cmdnext_Click()


rsnewspaper.MoveNext
If rsnewspaper.EOF = True Then
rsnewspaper.MoveLast
MsgBox "U R at the last record"
cmdnext.Enabled = False
cmdlast.Enabled = False
End If
showdata
cmdprevious.Enabled = True
cmdfirst.Enabled = True
End Sub

Private Sub cmdprevious_Click()


rsnewspaper.MovePrevious
If rsnewspaper.BOF = True Then
rsnewspaper.MoveFirst
MsgBox "you are on the FIRST Record"
cmdprevious.Enabled = False
cmdfirst.Enabled = False
End If
showdata
cmdlast.Enabled = True
cmdnext.Enabled = True
End Sub

Private Sub cmdsave_Click()


92
If cbonewsid.Text = " " Or txtname.Text = " " Or txtdate.Value = " " Or txtprize.Text = " " Or
txteditor.Text = " " Or txtpages.Text = " " Then
MsgBox "Please enter the value in all the field"
Else
rsnewspaper.AddNew
rsnewspaper.Fields("Newspaper_id").Value = Val(cbonewsid.Text)
rsnewspaper.Fields("Name").Value = Trim(txtname)
rsnewspaper.Fields("Language").Value = Trim(cbolanguage.Text)
rsnewspaper.Fields("Prizepernewspaper").Value = Trim(txtprize.Text)
rsnewspaper.Fields("Date").Value = txtdate.Value
rsnewspaper.Fields("Pages").Value = Val(txtpages.Text)
rsnewspaper.Fields("Noofcopies").Value = Val(txtcopies.Text)
rsnewspaper.Fields("Editor").Value = Trim(txteditor.Text)
rsnewspaper.Fields("Totalprize").Value = Val(txttotalprize.Text)
rsnewspaper.Update
MsgBox "Records saved"
rsnewspaper.MoveNext
End If
Call navenable(Me)
Call txtlock(Me)
cmddelete.Enabled = True
End Sub

Private Sub cmdsearch_Click()


On Error GoTo err
If txtsearch.Text = "" Or cbosearch.Text = "" Then
MsgBox "Enter the value"
Exit Sub
End If
If cbosearch.Text = "Newspaper ID" Then
If txtsearch.Text = "" Then
MsgBox "Enter the value"
Exit Sub
End If
rsnewspaper.MoveFirst
While rsnewspaper.EOF = False
If Val(txtsearch.Text) = Val(rsnewspaper.Fields("Newspaper_id").Value) Then
Call showdata
Exit Sub
Else
rsnewspaper.MoveNext
End If
93
Wend
End If
If cbosearch.Text = "Newspaper Name" Then
If txtsearch.Text = "" Then
MsgBox "Enter the value"
Exit Sub
End If
rsnewspaper.MoveFirst
While rsnewspaper.EOF = False
If UCase(txtsearch.Text) = UCase(rsnewspaper.Fields("Name").Value) Then
Call showdata
Exit Sub
Else
rsnewspaper.MoveNext
End If
Wend
End If
err: MsgBox ("Record Not Found")
rsnewspaper.MoveFirst
Call showdata
txtsearch.Text = ""
cbosearch.Text = ""
End Sub

Private Sub cmdupdate_Click()


rsnewspaper.Fields("newspaper_id").Value = Val(cbonewsid.Text)
rsnewspaper.Fields("Name").Value = Trim(txtname)
rsnewspaper.Fields("Language").Value = cbolanguage.Text
rsnewspaper.Fields("Prizepernewspaper").Value = Val(txtprize.Text)
rsnewspaper.Fields("Date").Value = txtdate.Value
rsnewspaper.Fields("Pages").Value = Val(txtpages.Text)
rsnewspaper.Fields("Noofcopies").Value = Val(txtcopies.Text)
rsnewspaper.Fields("Editor").Value = Trim(txteditor.Text)

rsnewspaper.Fields("Totalprize").Value = Val(txttotalprize.Text)

rsnewspaper.Update
MsgBox "Records updated"
cmdadd.Enabled = True
cmdmodi.Enabled = True
cmddelete.Enabled = True
cmdupdate.Enabled = False
94
cmdcancel.Enabled = False
Call navenable(Me)
Call txtlock(Me)
End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
rsnewspaper.Open "Newspaper", cn, adOpenDynamic, adLockOptimistic
Call txtlock(frmNewspaper)
'Call showdata
rsnewspaper.MoveFirst
Do While Not rsnewspaper.EOF() = True
cbonewsid.AddItem rsnewspaper.Fields("Newspaper_id").Value
rsnewspaper.MoveNext
Loop
cbolanguage.Enabled = False
cbonewsid.Enabled = True
cmdnext.Enabled = False
cmdprevious.Enabled = False
cmdcancel.Enabled = False
cmdsave.Enabled = False
cmdupdate.Enabled = False
txtsearch.Locked = False
rsnewspaper.MoveFirst
Call showdata
End Sub
Public Sub showdata()
cbonewsid.Text = rsnewspaper.Fields("newspaper_id").Value
txtname.Text = rsnewspaper.Fields("Name").Value
cbolanguage.Text = rsnewspaper.Fields("Language").Value
txtprize.Text = rsnewspaper.Fields("Prizepernewspaper").Value
txtdate.Value = rsnewspaper.Fields("Date").Value
txtpages.Text = rsnewspaper.Fields("Pages").Value
txtcopies.Text = rsnewspaper.Fields("Noofcopies").Value
txteditor.Text = rsnewspaper.Fields("Editor").Value
txttotalprize.Text = rsnewspaper.Fields("Totalprize").Value
End Sub
Private Sub Form_Unload(Cancel As Integer)
If rsnewspaper.State = adStateOpen Then
rsnewspaper.Close
End If
End Sub
95
Private Sub txtcopies_KeyPress(KeyAscii As Integer)
If Not Chr(KeyAscii) Like "[0-9]" And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter NUMBERS only"
End If
End Sub

Private Sub txtname_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[A-Z]" And Not Chr(KeyAscii) Like "[a-z]" And Not KeyAscii
Like 32 And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter characters only!", vbOKOnly
End If
End Sub

Private Sub txtpages_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[0-9]" And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter NUMBERS only"
End If
End Sub

Private Sub txtprize_KeyPress(KeyAscii As Integer)


If Not Chr(KeyAscii) Like "[0-9]" And Not KeyAscii Like 8 Then
KeyAscii = 0
MsgBox "Enter NUMBERS only"
End If
End Sub

Private Sub txtprize_LostFocus()


txttotalprize.Text = txtprize.Text * txtcopies.Text
End Sub

96
ISSUE TRANSACTION

97
CODE:

Private r1 As New ADODB.Recordset


Private rsmember As New ADODB.Recordset
Private rsbook As New ADODB.Recordset
Private rsbkissue As New ADODB.Recordset
Dim counte As Integer

Private Sub cbobookname_LostFocus()


If Trim(cbobookname) = " " Then
MsgBox "Please Enter the Book name"
Else
rsbook.MoveFirst
Do While Not rsbook.EOF = True
If cbobookname.Text = rsbook.Fields("BookName").Value Then
txtaccessionno.Text = rsbook.Fields("Accessionno").Value
End If
rsbook.MoveNext
Loop
End If
End Sub

Private Sub cbomemberid_LostFocus()


If Trim(txtmemberid) = " " Then
MsgBox "Please Enter the Member ID"
Else
rsmember.MoveFirst
Do While Not rsmember.EOF = True
If rsmember.Fields("Memberid").Value = Val(cbomemberid.Text) Then
txtmembername.Text = Trim(rsmember.Fields("Name").Value)

End If
rsmember.MoveNext
Loop
End If
Exit Sub
End Sub
98
Private Sub cmdexit_Click()
Unload Me
End Sub
Private Sub cmdissue_Click()
If txtaccessionno.Text = " " Then
MsgBox "Please select the book for issue.", vbInformation + vbOKOnly, "Select Book"
Else
If cbomemberid.Text = " " Then
MsgBox "Please select the Student.", vbInformation + vbOKOnly, "Select Book"
Else
Set bkissue = New ADODB.Recordset
bkissue.Open "issue_for_home", cn, adOpenDynamic, adLockOptimistic

bkissue.AddNew

rsbkissue.Fields("Member_ID").Value = Val(txtmemberid.Text)
rsbkissue.Fields("BookNo").Value = Val(txtaccessionno.Text)
rsbkissue.Fields("Membername").Value = Trim(txtmembername.Text)
rsbkissue.Fields("BookName").Value = Trim(cbobookname.Text)
rsbkissue.Fields("Issuedate").Value = Trim(txtissuedate.Text)
rsbkissue.Fields("Duedate").Value = Trim(txtduedate.Text)

txtaccessionno.Text = " "


cbobookname.Text = " "
cbomemberid.Text = " "
txtmembername.Text = " "
txtissuedate.Text = Date
MsgBox "Transaction done successfully !", vbInformation, "Book"
End If
End If

rsbkissue.Close
MsgBox ("Issued Book ")
If s = vbYes Then
If lblmembername.Caption = "" Then
MsgBox "NEEEE"
Exit Sub
If txtmembername.Text = " " Then
MsgBox "Member Not Found..!", vbExclamation + vbOKOnly, Caption
99
txtmemberid.SetFocus
Exit Sub
End If
If Trim(txtmemberid) = " " Or _
Trim(cboaccessionno) = " " Then

MsgBox "Please enter the fields.."


Exit Sub
End If

counte = 0
rsbkissue.MoveFirst
Do While Not rsbkissue.EOF = True
If Val(cbomemberid.Text) = rsbkissue.Fields("Memberid").Value Then
counte = counte + 1
End If
rsbkissue.MoveNext
Loop

If s = vbYes Then
GoTo continue
Else

cbomemberid.SetFocus
End If
Exit Sub

continue:
If lblisin.Caption = False Then
MsgBox "Book is not present in Library", vbOKOnly + vbInformation
Exit Sub
End If
If Val(txtbookname.Text) >= M.maxbooks Then
MsgBox " Memeber already has the books"

cbomemberid.SetFocus
Exit Sub
End If
a:
Dim counter As Integer
counter = 1
With rsbkissue
100
.AddNew

.Fields("Memberid").Value = Val(txtmemberid.Text)
.Fields("Accessionno").Value = Val(txtbookaccessionno.Text)
.Fields("MemberName").Value = Format(dtissue.Value, "mm,dd,yyyy")
.Fields("BookName").Value = Format(rtn.Value, "mm,dd,yyyy")
.Fields("Issuedate").Value = Val(cmbdays.Text)
counte = counte + 1
.Fields("BOOKS_IN_HANDS").Value = counte
End With
s = MsgBox("Issue Book " & lblbooktitle.Caption & " To " & lblmembername.Caption,
vbYesNo + vbQuestion, "Issue Book")
If s = vbYes Then
If lblmembername.Caption = "" Then
MsgBox "NEEEE"
Exit Sub
End If
rsbkissue.Update
lblisin.Caption = False
rsbook.MoveFirst
While rsbook.EOF = False
If rsbook.Fields("Accessionno").Value = Val(cboaccessionno.Text) Then
rsbook.Fields("IS_IN").Value = lblisin.Caption
rsbook.Update
End If
rsbook.MoveNext
Wend
rsbkissue.MoveFirst
Do While Not rsbkissue.EOF = True
If rsbkissue.Fields("Memberid").Value = Val(cbomemberid.Text) Then
rsbkissue.Fields("BOOKS_IN_HANDS").Value = counte
End If
rsbkissue.MoveNext
Loop

Else
rsbkissue.CancelUpdate
Exit Sub
End If

End Sub

101
Private Sub Command1_Click()
Call txtblank(Me)
End Sub

Private Sub Form_Load()


rsbkissue.Open "select * from issue_for_home", cn, adOpenDynamic, adLockOptimistic
Me.WindowState = vbMaximized

txtissuedate.Text = Now
txtduedate.Text = Now + 7

If cn.State = adStateOpen Then


cn.Close
End If
cn.Open
rsmember.Open "select * from Member", cn, adOpenDynamic, adLockOptimistic
Do While Not rsmember.EOF = True
cbomemberid.AddItem rsmember.Fields("Memberid").Value
rsmember.MoveNext
Loop
rsbook.Open "select * from Book", cn, adOpenDynamic, adLockOptimistic
Do While Not rsbook.EOF = True
cbobookname.AddItem rsbook.Fields("BookName").Value
rsbook.MoveNext
Loop
txtissuedate.Text = Format(Now, "dd, mm, yyyy")
txtissuedate.Text = Now
End Sub

Private Sub txtaccessionno_LostFocus()


If txtmemberid = " " Or txtaccessionno = " " Then
MsgBox "Please enter the fields.."
Exit Sub
End If
'cn.Open
rsbkissue.Open "select * from issue_for_home", cn, adOpenDynamic, adLockOptimistic
rsbkissue.MoveFirst
Do While Not rsbkissue.EOF = True
If Val(txtaccessionno.Text) = rsbkissue.Fields("Accessionno").Value Then
txtisin = "Issued"
Else
txtisin = "Not Issued"
102
End If
rsbkissue.MoveNext
Loop
rsbkissue.Close
End Sub

RETURN TRANSACTION

103
CODE:

Private rsreturn As New ADODB.Recordset


Private rsmember As New ADODB.Recordset
Private rsbook As New ADODB.Recordset
Private rsbkissue As New ADODB.Recordset

Private Sub cbomemberid_LostFocus()


If Trim(cbomemberid) = " " Then
MsgBox "Please Enter the Member ID"
Else
rsbkissue.MoveFirst
Do While Not rsbkissue.EOF = True
If rsbkissue.Fields("Member_id").Value = cbomemberid.Text Then
txtmembername.Text = rsbkissue.Fields("MemberName").Value
cboaccessionno.Text = rsbkissue.Fields("Accessionno").Value
txtbookname.Text = rsbkissue.Fields("BookName").Value
End If
rsbkissue.MoveNext
Loop
End If
Exit Sub
End Sub

Private Sub cmdexit_Click()


Unload Me
End Sub
Private Sub cmdreturn_Click()
If cbomemberid = " " Or cboaccessionno = " " Then
MsgBox "Please enter the fields.."
Exit Sub
End If

MsgBox currentdate & " " & rtndate


finedays = DateDiff("d", rtndate, currentdate)
If finedays >= 1 Then
totalfine = (finedays * M.fine)
MsgBox "Due Days " & finedays & " Previous Fine " & Val(lblfinebal.Caption)
104
MsgBox "The Member has Kept the Book:" & txtbookaccessionno & " For " & finedays & "
days extra," & vbCrLf & _
" And Must pay Rs." & totalfine & "/-", vbInformation, "Fine Charged.."
End If
Exit Sub
s = MsgBox("Return Book " & txtbookname.Text & " From " & txtmembername.Text,
vbYesNo + vbQuestion, "Issue Book")
If s = vbYes Then
rsbkissue.MoveFirst
While rsbkissue.EOF <> True
If Val(cboaccessionno.Text) = rsbkissue.Fields("Accessionno").Value Then
d = rsbkissue.Fields("BOOKS_IN_HANDS").Value
rsbkissue.Delete
txtisin.Text = True
rsbkissue.MoveFirst
Do While Not rsbkissue.EOF = True
If rsbkissue.Fields("member_ID").Value = Val(cbomemberid.Text) Then
rsbkissue.Fields("BOOKS_IN_HANDS").Value = d - 1
End If
rsbkissue.MoveNext
Loop
rsbook.MoveFirst
While rsbook.EOF = False
If rsbook.Fields("Accessionno").Value = Val(txtaccessionno.Text) Then
rsbook.Fields("IS_IN").Value = True
rsbook.Update
End If
rsbook.MoveNext
Wend
While rsmember.EOF = False
If rsmember.Fields("MEMBER_ID").Value = Val(txtmemberid.Text) Then
rsmember.Fields("BAL").Value = rsmember.Fields("BAL").Value + totalfine
rsmember.Update
End If
rsmember.MoveNext
Wend

Exit Sub
End If
rsbkissue.MoveNext
Wend
End If
105
End Sub

Private Sub Form_Load()

Me.WindowState = vbMaximized

If cn.State = adStateOpen Then


cn.Close
End If
cn.Open

rsbkissue.Open "select * from issue_for_home", cn, adOpenDynamic, adLockOptimistic


Do While Not rsbkissue.EOF = True
cbomemberid.AddItem rsbkissue.Fields("Member_id").Value
cboaccessionno.AddItem rsbkissue.Fields("Accessionno").Value
txtissuedate.Text = rsbkissue.Fields("issuedate").Value
txtduedate.Text = rsbkissue.Fields("duedate").Value
rsbkissue.MoveNext
Loop
txtreturndate.Text = Format(Now, "dd-mm-yyyy")
End Sub

106
GLOBAL INFORMATION:

107
CODE:

Private rsbook As New ADODB.Recordset


Private rsmember As New ADODB.Recordset
Private rsmagzine As New ADODB.Recordset
Private rsnewspaper As New ADODB.Recordset
Private rsbkissue As New ADODB.Recordset
Private rsemployee As New ADODB.Recordset
Private rslibraryissue As New ADODB.Recordset

Private Sub cmdexit_Click()


Unload Me
End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
If cn.State = adStateOpen Then
cn.Close
End If
cn.Open
rsbook.Open "select Accessionno from Book", cn, adOpenDynamic, adLockBatchOptimistic
rsmember.Open "select Memberid from Member", cn, adOpenDynamic,
adLockBatchOptimistic
rsemployee.Open "select Emp_id from Employee", cn, adOpenDynamic,
adLockBatchOptimistic
rsmagzine.Open "select Magzine_id from Magzine", cn, adOpenDynamic,
adLockBatchOptimistic
rsnewspaper.Open "select Newspaper_id from Newspaper", cn, adOpenDynamic,
adLockBatchOptimistic
rsbkissue.Open "select BookNo from issue_for_home", cn, adOpenDynamic,
adLockBatchOptimistic

Dim c As Integer
Dim counter As Integer
counter = 0
If rsbook.EOF And rsbook.BOF Then
counter = 0
Else
108
rsbook.MoveFirst
While rsbook.EOF <> True
counter = counter + 1
rsbook.MoveNext
Wend
End If
txttotalbooks.Text = counter
counter = 0
If rsmember.EOF And rsmember.BOF Then
counter = 0
Else
rsmember.MoveFirst
While rsmember.EOF <> True
counter = counter + 1
rsmember.MoveNext
Wend
End If
txtmember.Text = counter
counter = 0
If rsemployee.EOF And rsemployee.BOF Then
counter = 0
Else
rsemployee.MoveFirst
While rsemployee.EOF <> True
counter = counter + 1
rsemployee.MoveNext
Wend
End If
txtstaff.Text = counter
counter = 0
If rsbkissue.EOF And rsbkissue.BOF Then
counter = 0
Else
rsbkissue.MoveFirst
While rsbkissue.EOF <> True
counter = counter + 1
rsbkissue.MoveNext
Wend
End If
txtbooksissued.Text = counter
counter = 0
If rsmagzine.EOF And rsmagzine.BOF Then
109
counter = 0
Else
rsmagzine.MoveFirst
While rsmagzine.EOF <> True
counter = counter + 1
rsmagzine.MoveNext
Wend
End If
totalmags.Text = counter
counter = 0

If rsnewspaper.EOF And rsnewspaper.BOF Then


counter = 0
Else
rsnewspaper.MoveFirst
While rsnewspaper.EOF <> True
counter = counter + 1
rsnewspaper.MoveNext
Wend
End If
txtnewspaper.Text = counter
counter = 0

If rslibraryissue.EOF And rslibraryissue.BOF Then


counter = 0
Else
rslibraryissue.MoveFirst
While rslibraryissue.EOF <> True
counter = counter + 1
rslibraryissue.MoveNext
Wend
End If
txtmagissued.Text = counter
txtbooksin.Text = Val(txttotalbooks.Text) - Val(txtbooksissued.Text)
txtmagin.Text = Val(totalmags.Text) - Val(txtmagissued.Text)
Exit Sub
err:
MsgBox err.Description
End Sub

110
CREATE NEW USER:

111
CODE:

Option Explicit
Dim rsuser As ADODB.Recordset
Dim user As String
Dim pass As String

Private Sub cmdcancel_Click()


Unload Me
End Sub

Private Sub cmdcreate_Click()


If txtpass.Text = "" And txtconfirmpass.Text = "" Then
MsgBox "Please enter correct password", vbOKOnly, "Library Managment System"
Exit Sub
End If
If Len(txtpass.Text) <= 5 Then
MsgBox "Please refer the note given above", vbOKOnly, "Library Managment System"
txtpass.Text = ""
txtconfirmpass.Text = " "
txtpass.SetFocus
Exit Sub
End If
pass = txtpass.Text
Do Until rsuser.EOF
If txtusername.Text = rsuser.Fields(0) Then
MsgBox "Please enter the different user name", vbOKOnly, "Library Managment System"
txtusername = " "
txtusername.SetFocus
Exit Sub
End If
rsuser.MoveNext
Loop
rsuser.MoveFirst
If txtpass.Text <> txtconfirmpass.Text Then
MsgBox "Enter the same text for password as well as confirm password", vbOKOnly,
"Library Managment System"
txtconfirmpass.Text = ""
112
txtconfirmpass.SetFocus
Exit Sub
End If
rsuser.AddNew
rsuser.Fields(0) = txtusername.Text
rsuser.Fields(1) = txtpass.Text
rsuser.Update
MsgBox "New user accont is successfully created for the system", vbOKOnly, "Library
Managment System"
MsgBox "New user " & (txtusername.Text) & "is able to access this Management System",
vbOKOnly, "Library Managment System"
frmSplash.Show
frmSplash.Enabled = True
frmLogin.Hide
Me.Hide

End Sub

Private Sub cmdnewaccount_Click()


txtusername.SetFocus
cmdcreate.Enabled = True
cmdnewaccount.Enabled = False

End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
cn.Open
rsuser.Open "Login", cn, adOpenDynamic, adLockOptimistic
txtpass.PasswordChar = "*"
txtconfirmpass.PasswordChar = "*"
cmdcreate.Enabled = False

End Sub

Private Sub Form_Unload(Cancel As Integer)

cn.Close
End Sub

113
CHANGE PASSWORD:

114
CODE:

Private rspass As New ADODB.Recordset


Private Sub cmdexit_Click()
Dim a As String
a = MsgBox("Do you want to exit", vbYesNo + vbQuestion + vbDefaultButton1, "Exit
Window")
If a = vbYes Then
Unload Me
End If
End Sub

Private Sub cmdok_Click()


If txtnewpass.Text = txtconpass.Text Then
rspass.MoveFirst
Do While Not rspass.EOF = True
If cbousername.Text = rspass.Fields("UserName").Value And txtcurrpass.Text =
rspass.Fields("Password").Value Then
rspass.Fields("Password").Value = txtnewpass.Text
MsgBox "password successfully changed"
Exit Sub
End If
rspass.MoveNext
Loop
Else
MsgBox "new and confirm password does not match"
End If
End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
cn.Open
rspass.Open "Login", cn, adOpenDynamic, adLockOptimistic
rspass.MoveFirst
Do While Not rspass.EOF() = True

115
cbousername.AddItem rspass.Fields("UserName").Value
rspass.MoveNext Loop
rspass.Open "Login", cn, adOpenDynamic, adLockOptimistic
cbousername.AddItem "Administrator"
cbousername.AddItem rspass.Fields("UserNameame").Value
CMBUSER.AddItem "Employee"
End Sub
REPORT OF BOOK MASTER:

116
CODE:

Private rsbook As New ADODB.Recordset

Private Sub cmdcancel_Click()


Unload Me
End Sub

Private Sub cmdshowreport_Click()


cr1.ReportFileName = App.Path & "\reports\rptbook.rpt"
cr1.ReplaceSelectionFormula "{Book.Accessionno}=" & (cbobookid.Text)
cr1.WindowState = crptMaximized
cr1.Destination = crptToWindow
cr1.DiscardSavedData = True
cr1.PrintReport
End Sub

Private Sub cmdviewall_Click()


cr2.ReportFileName = App.Path & "\reports\rptbook.rpt"
cr2.WindowState = crptMaximized
cr2.Destination = crptToWindow
cr2.DiscardSavedData = True
cr2.PrintReport
End Sub

Private Sub Form_Load()

rsbook.Open "select * from Book", cn, adOpenDynamic, adLockOptimistic


While Not rsbook.EOF
cbobookid.AddItem rsbook.Fields("Accessionno").Value
rsbook.MoveNext
Wend
rsbook.MoveFirst
cbobookid.Text = rsbook.Fields("Accessionno").Value
117
End Sub

Private Sub Form_Unload(Cancel As Integer)


If rsbook.State = adStateOpen Then
rsbook.Close
End If
End Sub

118
REPORT OF MEMBER MASTER:

119
CODE:

Private rsmember As New ADODB.Recordset

Private Sub cmdcancel_Click()


Unload Me
End Sub

Private Sub cmdshowreport_Click()


cr1.ReportFileName = App.Path & "\reports\rptmember.rpt"
cr1.ReplaceSelectionFormula "{Member.Memberid}=" & (cbomemberid.Text)
cr1.WindowState = crptMaximized
cr1.Destination = crptToWindow
cr1.DiscardSavedData = True
cr1.PrintReport
End Sub

Private Sub cmdviewall_Click()


cr2.ReportFileName = App.Path & "\reports\rptmember.rpt"
cr2.WindowState = crptMaximized
cr2.Destination = crptToWindow
cr2.DiscardSavedData = True
cr2.PrintReport
End Sub

Private Sub Form_Load()

rsmember.Open "select * from Member", cn, adOpenDynamic, adLockOptimistic


While Not rsmember.EOF
cbomemberid.AddItem rsmember.Fields("Memberid").Value
rsmember.MoveNext
Wend
rsmember.MoveFirst
120
cbomemberid.Text = rsmember.Fields("Memberid").Value
End Sub

Private Sub Form_Unload(Cancel As Integer)


If rsmember.State = adStateOpen Then
rsmember.Close
End If
End Sub

121
REPORT OF EMPLOYEE MASTER:

122
CODE:

Private rsemployee As New ADODB.Recordset


Private Sub cmdcancel_Click()
Unload Me
End Sub

Private Sub cmdshowreport_Click()


cr1.ReportFileName = App.Path & "\reports\rptemployee.rpt"
cr1.ReplaceSelectionFormula "{Employee.Emp_id}=" & (cboemployeeid.Text)
cr1.WindowState = crptMaximized
cr1.Destination = crptToWindow
cr1.DiscardSavedData = True
cr1.PrintReport
End Sub

Private Sub cmdviewall_Click()


cr2.ReportFileName = App.Path & "\reports\rptemployee.rpt"
cr2.WindowState = crptMaximized
cr2.Destination = crptToWindow
cr2.DiscardSavedData = True
cr2.PrintReport
End Sub

Private Sub Form_Load()

rsemployee.Open "select * from Employee", cn, adOpenDynamic, adLockOptimistic


While Not rsemployee.EOF
cboemployeeid.AddItem rsemployee.Fields("Emp_id").Value
rsemployee.MoveNext
Wend
rsemployee.MoveFirst
cboemployeeid.Text = rsemployee.Fields("Emp_id").Value
End Sub
123
Private Sub Form_Unload(Cancel As Integer)
If rsemployee.State = adStateOpen Then
rsemployee.Close
End If
End Sub

124
REPORT OF NEWSPAPER MASTER:

125
CODE:

Private rsnewspaper As New ADODB.Recordset

Private Sub cmdcancel_Click()


Unload Me
End Sub

Private Sub cmdshowreport_Click()


cr1.ReportFileName = App.Path & "\reports\rptnewspaper.rpt"
cr1.ReplaceSelectionFormula "{Newspaper.Newspaper_id}=" & (cbonewspaperid.Text)
cr1.WindowState = crptMaximized
cr1.Destination = crptToWindow
cr1.DiscardSavedData = True
cr1.PrintReport
End Sub

Private Sub cmdviewall_Click()


cr2.ReportFileName = App.Path & "\reports\rptnewspaper.rpt"
cr2.WindowState = crptMaximized
cr2.Destination = crptToWindow
cr2.DiscardSavedData = True
cr2.PrintReport
End Sub

Private Sub Form_Load()

rsnewspaper.Open "select * from Newspaper", cn, adOpenDynamic, adLockOptimistic


While Not rsnewspaper.EOF
cbonewspaperid.AddItem rsnewspaper.Fields("Newspaper_id").Value
rsnewspaper.MoveNext
Wend
rsnewspaper.MoveFirst
cbonewspaperid.Text = rsnewspaper.Fields("Newspaper_id").Value
126
End Sub

Private Sub Form_Unload(Cancel As Integer)


If rsnewspaper.State = adStateOpen Then
rsnewspaper.Close
End If
End Sub

127
REPORT OF MAGZINE MASTER:

128
CODE:

Private rsmagzine As New ADODB.Recordset


Private Sub cmdcancel_Click()
Unload Me
End Sub

Private Sub cmdshowreport_Click()


cr1.ReportFileName = App.Path & "\reports\rptmagzine.rpt"
cr1.ReplaceSelectionFormula "{Magzine.Magzine_id}=" & (cbomagzineid.Text)
cr1.WindowState = crptMaximized
cr1.Destination = crptToWindow
cr1.DiscardSavedData = True
cr1.PrintReport
End Sub

Private Sub cmdviewall_Click()


cr2.ReportFileName = App.Path & "\reports\rptmagzine.rpt"
cr2.WindowState = crptMaximized
cr2.Destination = crptToWindow
cr2.DiscardSavedData = True
cr2.PrintReport
End Sub

Private Sub Form_Load()

rsmagzine.Open "select * from Magzine", cn, adOpenDynamic, adLockOptimistic


While Not rsmagzine.EOF
cbomagzineid.AddItem rsmagzine.Fields("Magzine_id").Value
rsmagzine.MoveNext
Wend
rsmagzine.MoveFirst
129
cbomagzineid.Text = rsmagzine.Fields("Magzine_id").Value
End Sub

Private Sub Form_Unload(Cancel As Integer)


If rsmagzine.State = adStateOpen Then
rsmagzine.Close
End If
End Sub

130
REPORT OF ISSUE BOOK:

131
CODE:

Private rsbkissue As New ADODB.Recordset

Private Sub cmdcancel_Click()


Unload Me
End Sub

Private Sub cmdviewall_Click()


cr2.ReportFileName = App.Path & "\reports\rptissuereport.rpt"
cr2.WindowState = crptMaximized
cr2.Destination = crptToWindow
cr2.DiscardSavedData = True
cr2.PrintReport
End Sub
Private Sub cmdviewselected_Click()
cr1.ReportFileName = App.Path & "\reports\rptissuereport.rpt"
cr1.ReplaceSelectionFormula "{issue_for_home.Member_ID}=" & (cbomemberid.Text)
cr1.WindowState = crptMaximized
cr1.Destination = crptToWindow
cr1.DiscardSavedData = True
cr1.PrintReport
End Sub
Private Sub Form_Load()

rsbkissue.Open "select * from issue_for_home", cn, adOpenDynamic, adLockOptimistic


While Not rsbkissue.EOF
cbomemberid.AddItem rsbkissue.Fields("Member_ID").Value
rsbkissue.MoveNext
Wend
rsbkissue.MoveFirst
cbomemberid.Text = rsbkissue.Fields("Member_ID").Value
End Sub
132
Private Sub Form_Unload(Cancel As Integer)
If rsbkissue.State = adStateOpen Then
rsbkissue.Close
End If
End Sub

133
NOTEPAD:

134
CODE:

Private Sub mnunotepad_Click()


On Error GoTo errHandle
Dim a As Double
a = Shell("c:\windows\notepad.exe", vbNormalFocus)
Exit Sub
errHandle:
MsgBox "Unable to run Notepad Utility on your computer", vbInformation, "Error in
opening!!!"
Resume Next
End Sub

135
CALCULATOR:

136
CODE:

Private Sub mnucalculator_Click()


Shell "C:\WINDOWS\system32\calc.exe"
End Sub

137
HELP FILE

138
CODE:

Public Sub addnotes()


Dim intro, master, books, member, sk, staff, setting, missbook, purchase, transaction,
reports, deposit, bkissue, fine As Node
Set intro = t.Nodes.Add
t.Nodes(1).Key = "intro"
t.Nodes(1).Text = "Introduction"
t.Nodes(1).Image = "hlp"
Set master = t.Nodes.Add("intro", tvwNext, "master", "Master", "hlp")
Set books = t.Nodes.Add("master", tvwChild, "books", "Books", "leaf")
Set members = t.Nodes.Add(master, tvwChild, "member", "Members", "leaf")
Set staff = t.Nodes.Add(master, tvwChild, "staff", "Staff", "leaf")
Set transaction = t.Nodes.Add(master, tvwNext, "transaction", "Transaction", "hlp")
Set bookissue = t.Nodes.Add("transaction", tvwChild, "bkissue", "Issue", "leaf")
Set deposit = t.Nodes.Add("transaction", tvwChild, "deposit", "Return", "leaf")
Set fine = t.Nodes.Add("transaction", tvwChild, "fine", "Pay Fine/Fees", "leaf")
Set missbook = t.Nodes.Add("transaction", tvwChild, "missbook", "Missing Book", "leaf")
Set purchase = t.Nodes.Add("transaction", tvwChild, "purchase", "Purchase", "leaf")
Set reports = t.Nodes.Add("transaction", tvwNext, "reports", "Reports", "hlp")
Set setting = t.Nodes.Add("reports", tvwNext, "setting", "Change setting", "hlp")
Set sk = t.Nodes.Add("setting", tvwNext, "sk", "Shortcut Keys", "hlp")
End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
Call addnotes

End Sub
139
Private Sub t_NodeClick(ByVal Node As MSComctlLib.Node)
Select Case Node.Text
Case "Introduction"
Rt1.LoadFile App.Path & "\helpfiles\intro.rtf"
Case "Books"
Rt1.LoadFile App.Path & "\help\BookMaster.rtf"
Case "Members"
Rt1.LoadFile App.Path & "\help\Membermaster.rtf"
Case "Staff"
Rt1.LoadFile App.Path & "\help\StaffMaster.rtf"
Case "Staff"
Rt1.LoadFile App.Path & "\help\StaffMaster.rtf"
Case "Master"
Rt1.LoadFile App.Path & "\help\masters.rtf"
Case "Issue"
Rt1.LoadFile App.Path & "\help\issue.rtf"
Case "Return"
Rt1.LoadFile App.Path & "\help\return.rtf"
Case "Reports"
Rt1.LoadFile App.Path & "\help\reports.rtf"
Case "Missing Book"

Case "Shortcut Keys"


Rt1.LoadFile App.Path & "\help\Shortcut Keys.rtf"
End Select
End Sub

140
ABOUT US

141
CODE:

Dim i As Integer
Dim j As Integer
Private Sub btnOk_Click()
Unload frmInfo
frmmdi.Show
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyEscape Then
Unload frmInfo
End If
End Sub

Private Sub Form_Load()


Me.WindowState = vbMaximized
End Sub

Private Sub Timer1_Timer()


If i = 16 Then
i=1
End If
If j = 16 Then
j=2
End If
Timer1.Interval = 100
lblInfo.ForeColor = QBColor(i)
Shape1.BorderColor = QBColor(j)
i=i+1
j=j+1
142
End Sub

143
TESTING AND IMPLEMENTATION

Implementation is a process involved in the complete development of software.


The implementation process is based upon the design methodology. The system is
implemented soon after the System ID tested and is found to satisfy all the requirements of
the clients, upon whose consent the system is implemented. There are several procedures to
b followed while implementing the software.

Before installing the proposed system we will have to supply the client, a detailed
report regarding the complete details and functions of the developed system. During confirm
whether the required hardware configuration for smooth and reliable running of the software
is present or not. The next step involved is entering the data.

During the implementation stages the client will never leave the existing system
until the client is fully satisfied with the proposed system and also during the initial stages
both the existing and proposed system will go hand in hand since some time is required for
the updating of the transactions. This project is tested by unit tests and integration tests.

144
Levels of Testing

Client Accepting
Needs Testing

System
Requirements Testing

Design
Integration
Testing

Code
Unit
Testing

Unit testing comprises the set of tests performed by an individual programmer prior to
integration of the unit into a larger system. Coding and debugging -> unit testing ->
integration testing

145
A program unit is usually small enough that the programmer who developed it can test it in
greater detail than will be possible when the unit is integrated into an evolving software
product.

Four categories of tests that a programmer will typically perform on a program unit:

Functional Test:

Functional test cases involve exercising the code with nominal input values for which the
expected results are known, as well as boundary values, (minimum values, maximum values,
and values on and just outside the functional boundaries) and special values, such as
logically related inputs, 1 * 1 matrices, the identity matrix, files of identical elements and
empty files.

Performance Test:

Performance testing determines the amount of execution time spent in various parts of the
unit, program throughput, response time, and device utilization by program unit. A certain
amount of performance tuning may be done during unit testing. However, caution must be
exercised to avoid expending too much effort on fine-tuning of a program unit that
contributes little to the over all performance of the entire system. Performance testing is
most productive at the subsystem and system levels.

146
CHANGE OVER

Once the system has undergone satisfactory testing (unit, integration, system and
acceptance), it has to be operationalized. Implementation of the system is complete when the
system process current data and is used for operational purpose. Any older system is
discontinued.

Most problems of system usually surface at the time a change over are attempted to the
system. Important reasons for this are:

 Incomplete analysis
 Incorrect design
 Incomplete testing
 Misunderstanding on the requirements between the user and the system personnel

The change over to a new system is usually executed against a comprehensive plan contains.
 Identification of all activity required during change over
 Responsibility for each activity
 Schedule for each activity
 Steps to be followed for ach activity and the criteria for knowing when the activity is
to start and to end.

It is very important that the plan should assume problems will be found will need time and
resources to resolve. A common mistake is to plan assuming that it will be smooth sailing
and no problems will be found. In actual practice however problems some times are found to

147
be so major that some part of the system requires major rework. Minor problems are
common.

The broad categories of activities to change over to new systems after system testing
are:

 Preparation for change over


 Running of the new system and discontinuing the old system.

How To Operate The Project?

It must be checked that the computer is loaded with Microsoft Visual Basic 6.0 and
Microsoft Access. After installing the package, copy the exe from the base folder.
Double click the icon by mouse. Then the main screen appears with login module
inbuilt. If successfully logged in, the user can go on using the functionalities available.
Only administrator is capable of creating new login for a new user. Each successful
data update shows a message box with the message “Updated”

This is how you can operate LIBRARY MANAGEMENT SYSTEM

148
What to do when EXE file is corrupted?

It is highly recommended that a proper trainee should handle the software. During the
working of the software, it should be seen that proper shut down of the program takes
place. For a safety, a back up copy should be kept with the user. Using a feature
provided in the application can do this. Any data that has been lost while the exe was
corrupted cannot be recovered.

149
SELECTION OF HARDWARE AND SOFTWARE

SOFTWARE AND LANGUAGE STRUCTURE SELECTION

MICROSOFT VISUAL BASIC 6.0

Microsoft Visual Basic is the fastest and easiest way to create applications for
Microsoft Windows. Visual Basic provides you with a complete set of tools to
simplify rapid application development.

So what is Visual Basic? The “Visual” part refers to the method used to create the
graphical user interface (GUI) rather than writing numerous lines of code to describe
the appearance and location of interface elements, you simply add pre-built objects
into place on screen.

The “Basic” part refers to the BASIC (Beginners All Purpose Symbolic Instruction
Code) language, a language used by more programmers than any other language in the
history of computing. Visual Basic has evolved from the original BASIC language and
now contains several hundred statements, functions, and keywords, many of which
relate directly to the Windows GUI. Beginners can create useful applications by
learning a few of keywords.

The Visual Basic Programming Language is not unique to Visual Basic. The Visual
Basic programming system, Applications Edition included in Microsoft Excel,
Microsoft Access, and many other windows applications uses the same language. The
Visual Basic Scripting Edition (VBScript) is a widely used scripting language and a
subset of Visual Basic Language. The invest you make in learning in Visual Basic will
carry over to these other areas.
150
Visual Basic has following tools:

 Data access features allow u to create databases


 Active X™ technologies allow you to use the functionality provided by other
applications, such as Microsoft Word Processor, Microsoft Excel Spreadsheet, and
other Windows applications. You can even automate applications and objects created
using the Professional or Enterprise applications of Visual Basic.
 Internet capabilities make it easy to provide access to documents and applications
across the internet or intranet from within your application, or to create internet server
applications.
 Your finished application is a true .exe file that uses a Visual Basic Virtual Machine
that you can freely distribute.

151
BACK UP AND RECOVERY

As the backend of the software is the Microsoft Access, the IT department of the Library will
be handling the backup of the database.

Backup can be taken by the following methods:

 Floppy-Disk can be used


 Hard-Disks can be used
 Printouts can be taken for use

152
CONCLUSION

The “Library Management System” software has been designed at most capabilities and
efforts. It has tested for possible exceptions keeping in mind, the primary requirement of
‘building robust system’

This experience has enriched our knowledge of developing a software system and has
proved to be stepping stone in our career, also if project give us lot of knowledge about hotel
field which definitely help us in our career.

153
FUTURE ENHANCEMENT

This project has big scope towards the future developments. Due to the time factor we could
not add some of the more interesting features which may make the software more user-
friendly and free from user interaction.

Some of the features we could add to the system are as follows:

Implement the system for all types of services:

The current version of our system is only for Limited Services but we will going to include
different types of services.

Implementing the system as a window service:

By implementing the updater as a window service, we can start up the computer and keep
monitoring for the data. Also this will enable us to control the service more easily. A system
tray icon can be created for the faster access software interface. This can be done through the
use of Window API’s. Typically, the CreateService. Typically, the CreateService,
StartService API’s may help us do this.

Maintaining Registry Information for the software:

154
We can add the registry entries for this software to store some critical information about the
software in it. This will make easier for the software to manage the critical information at
some safe place. This can be done through some registry components in Visual Basic.

BIBLIOGRAPHY

The reference books used during this system development are as follows:-

Programming in VB Julia Case Bradley

System Analysis, Design and Prof. Seema Negi


Introduction to Software Engineering

An Integral Approach to Software Enginering Prof. Pankaj Jalote

E-books MSDN library

155

S-ar putea să vă placă și