Library Management System
Library Management System
SYSTEM
2
TABLE OF CONTENTS - II
1 ANALYSIS 28
2 DESIGN 30
3 CODING 37
4 OUTPUT WINDOWS 57
5 CONCLUSION 62
6 REFERENCE 63
3
ABSTRACT
The project focuses on the development skills of the user. The knowledge
acquired proves to be helpful and effective, only if it is implemented. The implementation
of the knowledge acquired is trough project and case studies based on real time scenarios.
Here in this project we use front end as VC++ and backend as ms-access.
We store information about the books and the students who have taken the books. All
these details are stored in the database by entering into VC++ and the details can be
displayed from the database by writing the query in VC ++. This project involves several
modules to carry out each action.
We created database for storing the details in tables .We created table for
MEMBER DETAILS, a table for storing BOOK DETAILS and another table for storing
the details of the students who have taken the books namely MEMBER BOOK
DETAILS.
We can also store the details at run time ,that is we can enter the student
details by entering the details of the student separately at run time. Likewise the
transaction details can also be entered at run time. We can either store in a database and
see the details when required or see the details at run time by selecting the option display.
4
Hence in the existing system for LIBRARY MANAGEMENT SYSTEM
,the performance evaluation system and the maintenance are done manually. The
proposed system will maintain all the information in a standard database and will be able
to generate reports as and when necessary.Accessing and the user has the right to search
based on the above mentioned criterias.
1. ANALYSIS PHASE
In this analysis phase, we have to design the project in mind how it has to
be and what are all the operations that has to carry in the project and how it has to be
interactive with the users and how it has to attract the customer.
The project has to contain all the details about the members in the library
and books in the library and the details the members who taken the books and this details
has to store in the database for this type we have to analyze the problem and we have to
develop the project. In this analysis phase we have to collect the details about the
project such as what are all operations that will make interactive and what are all the
fields that has to be present n the database and the database must store the details of all
the members and the book details and the members who taken the books.
In this analysis phase only we will collect the information about the
project. This is the first stage of the project. After this only we will start doing project that
is the design of the project will carry after this stage. After that we will write the project
coding and we will test the project.
5
This phase will take the duration up to 1 to 2 weeks for completion of this
analysis stage that is for collecting the requirements and it has to contain all the details
about the project. In some projects it will take more time for completion of the analysis
stage because it has to collect more requirements, it has to be depend upon the project it
will take duration, hence for small type of projects we can easily complete the project
within the short duration, for large projects it will take more duration for analysis stage
and also for completion of the project.
But for this project we can easily complete the project within the short
duration because it is like a mini project and also we can easily complete the stage of
analysis. If we completed the stage of analysis then it appears like we completed the 25%
of the project within short duration.
ACTIVITY DURATION
Design Phase 2 Weeks
Implementation 2 Weeks
Coding Phase 3 Weeks
View Result 2 Weeks
Execution & Demo 1 Week
Report Generation 1 Week
6
2. DESIGN PHASE
In this tables, one field has been given as primary key in the design of tables
because it won’t allow the duplicate values of members or it won’t accept the same id
number for different members.
For Book Details table also one primary key has been allocated for neglecting the
same values for the field Book number and another table was created that is for storing
the details of transaction that has been carried out, in that database it doesn’t have any
7
keys in that because it can contain the details many users can take the book with same
account number.
After creation of tables the user must design the project that is it can also
represent the design in the form of Data Flow Diagrams. In the Data Flow diagrams it
contains the levels that is it has to be represented in Level 0 DFD, Level 1 DFD, Level 2
DFD,… so that we can represent the Data flow diagrams in that format up to number of
DFD’s required in the project.
The user must design or draw the DFD diagrams based upon the project what it
will do, what are the operations that was carrying in the project it will represent the DFD
diagrams in the one by one operation that was carrying in the project.
The user must understand the project what are all the operations in the project that
was going to do or carrying out by seeing the DFD Diagrams. In that format the user
must draw the DFD diagram. The DFD diagram that must contain all the details of the
project.
In Level 0 DFD diagram, it will display the menus of the project that is
what are all we can do in the project. From that we can select the option what we are
going to do. Based upon the condition it display the next screen for the selected
operation.
SEARCHING DISPLAYING
THE THE BOOK
BOOK DETAILS
STUDENTBOOK
ENTERING
ENTERING
SEARCHING 8 DISPLAYING
STORING THE
ENTRY
THE
STUDENT
STUDENT
BOOK THE STUDENTS
BOOK
STUDENT
STUDENTBOOK
DETAILS
DETAIL DETAILS
2.2 LEVEL 1 DFD DIAGRAM:
In Level 1 DFD diagram it takes the input details and store the details in
the database. It takes the details separately for each table and store details separately in
each table.
NAME
MEM NO
TAKING
STORING THE INPUT
DETAILS IN DETAILS
THE ADDRESS
OF
DATABASE MEMBER
DOB
9
STOCK BOOK
BOOK NO
TAKING
STORING INPUT
THE DETAIL
DETAILS IN AUTHOR
S OF
THE BOOKS
EDITION
PUBLISHER
BOOK NO
TAKING
STORES THE
DETAIL
DETAILS IN
S OF
THE AUTHOR
TRANSA
DATABASE
CTIONS
EDITION
MEMBER DATE OF
NAME ISSUE
10
2.3 LEVEL 2 DFD DIAGRAM:
In Level 2 DFD diagram it displays the selected details or the details of all
books present in the library and the details of selected members or all the members who
are having the membership in the library and the transaction details of members who
have taken books.
NAME
MEM NO
DISPLAY
DISPLAYING ING
THE OUTPUT
DETAILS DETAILS ADDRESS
FROM THE OF
DATABASE MEMBER
DOB
2.3.2
STOCK BOOK
TO
NAME
BOOK NO
DISPLA
DISPLAYING YING
THE DETAIL
DETAILS S OF AUTHOR
FROM THE BOOKS
DATABASE
EDITION
PUBLISHER
11
2.3.3 TO DISPLAY THE DETAILS OF TRANSACTIONS
BOOK NO
DISPLAY
DISPLAYING ING
THE DETAILS
DETAILS OF AUTHOR
FROM THE REPORTS
DATABASE
EDITION
MEMBER DATE OF
NAME ISSUE
12
MS-ACCESS DATABASE : LIBRARY . MDB
FIELD NAME
DATATYPE SIZE
BOOKNO Text 50
BOOKNAME Text 50
AUTHOR Text 50
EDITION Text 50
PUBLISHER Text 50
STOCK Text 50
MEMNO Text 50
NAME Text 50
ADRESS Text 50
DOB Date/Time 8
13
2.4.3 TRANSACTION DETAILS TABLE
MEMNO Text 50
BOOKNO Text 50
BOOKNAME Text 50
NAME Text 50
AUTHOR Text 50
DATEOFBOOKISSUE Date/Time 8
DATEOFBOOKRETURN Date/Time 8
EDITION Text 50
14
3. CODING:
#include<iostream.h>
# include<stdio.h>
# include<conio.h>
# include<dos.h>
# include<string.h>
# include<math.h>
char name[50],aname[50];
int accno;
int ed;
int rk;
int rw;
int stock;
void selectcase();
void memdetails();
void bookdetails();
void transactiondetails();
void addnewbook();
15
void issuebook();
void menu();
void memmenu();
void bookmenu();
void reportmenu();
void exit();
void back();
void addnewmember();
void deletemember();
void addnewmember()
//clrscr();
char name[20];
char memno[10];
char address[10];
char dob[10];
cin>>memno;
cin>>name;
16
cout<<"ENTER THE ADDRESS:";
cin>>address;
cin>>dob;
CoInitialize(NULL);
try
strcat(temp,memno);
strcat(temp,"','");
strcat(temp,name);
strcat(temp,"','");
strcat(temp,address);
strcat(temp,"','");
strcat(temp,dob);
strcat(temp,"');");
_RecordsetPtr pRst("ADODB.Recordset");
pRst->Open(temp,strCnn,adOpenKeyset,adLockOptimistic,adCmdText);
pRst->MoveFirst();
while (!pRst->EndOfFile)
17
pRst->MoveNext();
pRst->Close();
cout<<(char*) e.Description();
selectcase();
void addnewbook()
//clrscr();
char name[20];
char bookno[10];
char aname[10];
18
char ed[10];
char pub[10];
char stock[10];
cin>>name;
cin>>bookno;
cin>>aname;
cin>>ed;
cin>>pub;
cin>>stock;
CoInitialize(NULL);
try
strcat(temp,bookno);
strcat(temp,"','");
strcat(temp,name);
strcat(temp,"','");
19
strcat(temp,aname);
strcat(temp,"','");
strcat(temp,ed);
strcat(temp,"','");
strcat(temp,pub);
strcat(temp,"','");
strcat(temp,stock);
strcat(temp,"');");
_RecordsetPtr pRst("ADODB.Recordset");
pRst->Open(temp,strCnn,adOpenKeyset,adLockOptimistic,adCmdText);
pRst->MoveFirst();
while (!pRst->EndOfFile)
pRst->MoveNext();
pRst->Close();
cout<<(char*) e.Description();
20
}
selectcase();
void issuebook()
char no[10];
char bno[10];
char date[10];
char edate[10];
char author[10];
char edition[10];
char name[50],bname[50];
cin>>no;
cin>>bno;
cin>>bname;
21
cin>>name;
cin>>author;
cin>>date;
cin>>edate;
cin>>edition;
CoInitialize(NULL);
try
strcat(temp,no);
strcat(temp,"','");
strcat(temp,bno);
strcat(temp,"','");
strcat(temp,bname);
strcat(temp,"','");
strcat(temp,name);
strcat(temp,"','");
strcat(temp,author);
22
strcat(temp,"','");
strcat(temp,date);
strcat(temp,"','");
strcat(temp,edate);
strcat(temp,"','");
strcat(temp,edition);
strcat(temp,"');");
_RecordsetPtr pRst("ADODB.Recordset");
pRst->Open(temp,strCnn,adOpenKeyset,adLockOptimistic,adCmdText);
pRst->MoveFirst();
while (!pRst->EndOfFile)
pRst->MoveNext();
} pRst->Close();
cout<<(char*) e.Description();
selectcase();
23
//TO DISPLAY THE MAIN SCREEN
void menu()
int a;
cout<<endl<<endl<<endl<<"\t\tLIBRARY MANAGEMENT"<<endl;
cout<<endl;
cout<<"1.MEMBERS"<<endl;
cout<<"2.BOOKS"<<endl;
cout<<"3.REPORTS"<<endl;
//cout<<"HELP"<<endl;
cout<<"4.EXIT"<<endl;
cout<<endl;
cin>>a;
switch(a)
case 1:
memmenu();
break;
case 2:
bookmenu();
break;
case 3:
24
reportmenu();
break;
case 4:
exit();
break;
default:
break;
getch();
void memmenu()
int b;
cout<<endl;
cout<<"3.BACK"<<endl;
cout<<endl;
25
cin>>b;
switch(b)
case 1:
addnewmember();
break;
case 2:
deletemember();
break;
case 3:
back();
break;
default:
break;
getch();
void bookmenu()
int b;
26
cout<<endl;
cout<<"2.ISSUE BOOK"<<endl;
// cout<<"BOOK DETAILS"<<endl;
cout<<"3.BACK"<<endl;
cout<<endl;
cin>>b;
switch(b)
case 1:
addnewbook();
break;
case 2:
issuebook();
break;
case 3:
back ();
break;
default:
break;
27
}
getch();
void toselectcase()
char y;
cin>>y;
cout<<endl;
if (y='y')
menu();
else
void exit();
void selectcase()
char y;
28
cout<<endl<<"To continue press any key:";
cin>>y;
cout<<endl;
if (y='y')
menu();
else
void back();
//MAIN FUNCTION
void main()
menu();
void deletemember()
29
//lrscr();
cin>>name;
cin>>accno;
cin>>aname;
cin>>ed;
cin>>rk;
cin>>rw;
cin>>stock; {
CoInitialize(NULL);
try
_RecordsetPtr pRst("ADODB.Recordset");
pRst->MoveFirst();
while (!pRst->EndOfFile) {
30
cout<<(char*) ((_bstr_t) pRst->GetFields()->GetItem("NAME")->GetValue())<<" ";
pRst->MoveNext();
pRst->Close();
cout<<(char*) e.Description();
::CoUninitialize();
selectcase();}
void reportmenu()
cout<<endl;
int c;
cout<<"1.MEMBER DETAILS"<<endl;
cout<<"2.BOOK DETAILS"<<endl;
cout<<"3.TRANSACTION DETAILS"<<endl;
cout<<"4.BACK"<<endl<<endl;
31
cout<<"ENTER YOUR CHOICE:";
cin>>c;
switch(c)
case 1:
memdetails();
break;
case 2:
bookdetails();
break;
case 3:
transactiondetails();
break;
case 4:
back();
break;
default:
break;
getch();
32
void exit()
exit();
void back()
cout<<endl;
cout<<endl;
menu();
void memdetails()
CoInitialize(NULL);
try
_RecordsetPtr pRst("ADODB.Recordset");
33
cout<<endl;
cout<<""<<endl;
pRst->MoveFirst();
while (!pRst->EndOfFile) {
cout<<endl;
cout<<"\t";
pRst->MoveNext();
pRst->Close();
cout<<(char*) e.Description();
} cout<<endl;
selectcase();
34
}
void bookdetails()
CoInitialize(NULL);
try
_RecordsetPtr pRst("ADODB.Recordset");
cout<<endl;
pRst->MoveFirst();
while (!pRst->EndOfFile)
cout<<endl;
cout<<"\t";
35
cout<<"\t";
cout<<"\t";
>GetValue())<<" ";
cout<<"\t";
pRst->MoveNext();
//cout<<endl;
pRst->Close();
cout<<(char*) e.Description();
::CoUninitialize();
cout<<endl;
selectcase();
36
}
void transactiondetails()
CoInitialize(NULL);
adLockReadOnly, adCmdText);
pRst->MoveFirst();
>GetValue())<<" ";
37
cout<<(char*) ((_bstr_t) pRst->GetFields()->GetItem("DATEOFBOOKISSUE")-
> GetValue())<<" ";
pRst->MoveNext();
pRst->Close();
{ cout<<(char*) e.Description();
selectcase();
4. OUTPUT WINDOWS
//MAIN MENU
38
//MEMBER MENU AND ADDING A NEW MEMBER
39
//TO STORE THE DETAILS OF NEW BOOK
40
// TO ISSUE BOOK TO THE MEMBER
41
// TO DISPLAY THE BOOK DETAILS
42
// TO EXIT THE PROGRAM
43
5. CONCLUSION:
44