CERTIFICATE This is to certify that this project entitled “Library Management System” submitted by Shaveta Rani and Sapna Sharma to Punjab Technical University, Jalandhar, is an original work and has not been submitted earlier whether to Punjab Technical University or to any other Institution or fulfillment of the requirement of a course of study . Date: Mr. Jayant Ahuja Mr. Manraj Mangat Project Instructor Head of the Institute
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
CERTIFICATE
This is to certify that this project entitled “Library Management
System” submitted by Shaveta Rani and Sapna Sharma to Punjab Technical
University, Jalandhar, is an original work and has not been submitted earlier
whether to Punjab Technical University or to any other Institution or
fulfillment of the requirement of a course of study .
Date:
Mr. Jayant Ahuja Mr. Manraj Mangat
Project Instructor Head of the Institute
STUDENT DECLAATION
We hereby declare that project report entitled
“Library Management System”
In “PTU LEARNING CENTER,LUDHIANA” submitted by Shaveta Rani
and Sapna Sharma in Partial fulfillment of the requirement for
BACHELORS OF SCIENCES [IMFORMATION TECHNOLOGY] to
“Punjab Technical University, Jalandhar”, is an original work and has not
been submitted the award of any degree/ Diploma/ Scholarship or any other
title or prizes.
Place: Ludhiana Shaveta Rani
Date: Sapna Sharma
TABLE OF CONTENTS
Preface
Introduction
Objectives
Existing System
Proposed System
Advantages of Computerization
Hardware and software Specifications
Analysis
System Design- Needs, Proposed solutions and Best Solutions
Implementation
Testing Techniques
System maintenance
Introduction of MS Access
Introduction of Visual Basic
Coding
Output Screens
Conclusion
Bibliography
ACKNOWLEDGEMENT
It has been a great privilege to conduct the present product under the
aegis of our Major Advisor Mr. Jayant Ahuja, Department of computer
Science. Our sincere thank and deep gratitude are due to his effective
guidance and encouragement, which gave us the confidence to complete the
poject work.
We are also grateful to Miss Lalita Madam, Mr. Manraj Mangat, Head
of the Institute for all their suppot during the project.
Our cordial and sincere thanks to all the teachers of Department of
computer Science.
We are deeply indebted to our Families and our friends for their unconditional support, deep affection and unabated inspiration, which kept us going.
We wish to thank all the respondents who extended their whole-hearted cooperation in carrying out this study.
Last but not the Least, we thank GOD who always showers His blessings upon all of us.
Place: Ludhiana Shaveta Rani
Date: Sapna Sharma
PREFACE
The preface of creation is a long process requiring time, energy and
dedication, as well as the skill and experience of all those persons engaged
in tasks, ultimately culminating in the outcome as the final form of
embodiment of the creator’s vision.
The process of System Analysis and Design is analogous to the above
fact. Here, the process of creation began long before the first line of the
program code for the new system is written, when the existing system is
systematically evaluated, analyzed, planned, properly described and
documented, criticized and appropriate modifications are suggested. The
facts and findings thus obtained are then synthesized as the new system I in
the designing phase.
The theoretical study and knowledge of this practice oriented subject
is further enhanced by applying it and understanding analysis and design of
real life installation of automated system, provided valuable hand practical
experience to the students. Our contemporary lives have been influenced by
advancement in computer science to such an extent that without them, the
ultra modern and advanced lifestyle of the 21st century is simply
unthinkable.
Computerization introduces accuracy, efficiency, integrity etc., and
reduces paper work, errors and time demands. The initial investment is in
the form of cost of computerization and justified in long run.
INTRODUCTION
Computers have brought a revolution in our day to day life. One of the most
significant uses of computer is to manage data and present information in a
particular form that is needed by the user. This is due to the high speed
processing, accuracy and efficiency provided by modern day computers. In
the same way as computers help us to manage data in different fields, the
same the does in the Library management. This project is dealing with the
Library management system.
Library system makes it easy for the institute to take care of the books
properly. Technology has changed the way you live. The invention of the
currency has ushered in a new breed of humans. The average adult spends
approximately one-third of his or her life in working. A considerable portion
of the expenditure of the business is on the compensation given to its
employees, therefore it become necessary to maintain the complete record of
the books and students.
The Library department of an organization maintains a record of
The books
The books issued
The students
The fine
We are closely related to the computers, now these days the computer is
our necessity. So, we are developing our project of computerized Library
system for the well known institute of Ludhiana “PUNJAB COLLEGE OF
TECHNICAL EDUCATION”. This institution has a great reputation. The
existing system in the institution is manual. In existing manual system lots
of time is needed to manage records and information accuracy in work is
less as compared to automated computerized system. Moreover, possibilities
of error, incorrect information cannot be ruled out. The only solution lies
with the modern system of computerization.
In our project we have done all things to be maintained properly so that
they can be maintained easily and no information should be loss. So I hope
that my new computerization Library system is helpful for the institute.
OBJECTIVES
As we know that the “Library Management System” is very large and complex system. There are many difficulties that are faced in the manual system. In out project we tried to minimize all these difficulties. We made this project computerized. In this all things will be done easily. The main objective of this project is to minimize the labour and increase the speed and make the user comfortable. The main objectives of my project are as follows:
To make understand all the process so that he could easily handle the
project.
The computerized system will lessen the burden of the books stored.
To provide the user the information which he needs i.e. to make it more
users friendly.
The fine will be calculated automatically.
It will be easy to handle all the records.
There will not be loss of any data.
The user could know about all the books according to ID number.
It will reduce anomalies to a great extent; the system will be more error
free.
Accepting the data from a user and send it to the database.
Validating the data entered by the user.
EXISTING SYSTEM
We know that the institute today is using this system manually. But we know that the manual system is very prone to errors. This work is very complex and tiresome so in such a long process many errors can occur. It is really very difficult for a man to maintain all the records correctly. If one error occurs it will produce many errors. There are many long processes in calculating the payment and we need registers to keep all these things.
The difficulties faced in the existing system are given below:
Much Laborious: In Library system we have to maintain the record of
each student and calculate his or her fine, which is very laborious work.
Need of High Time: These all works are very lengthy and complex. But
the time is limited a perfect man can do this work. Thus we need much
more time which is the wastage.
High Search Time: We need very high time to search any particular
record from such registers. It is very tiresome to find any particular
record or calculate the whole payment.
Redundancy of the Work: There may be the duplication of the work a
man can be recorded two or more times in a register or his payment or
allowances can be calculated many times which may result I the
redundancy.
More Prone to Human Errors: We know that man is prone to make
errors. If he is tired he may do many mistakes. These mistakes will result
in the wrong information, which will result in bias fault in financial
accounting.
Costly: These systems are much more costly. We have to keep a large
staff. A lot of money is wasted in this process.
Lack in Speed: Manual systems are very slow. A man cannot do much
more or fast work as a machine can do. Thus we can say that these
systems lack in speed.
PROPOSED SYSTEM
In our proposed system we tried to reduce all the discrepancies which are faced in the existing system. We made whole the system computerized.
We tried to make easy for the user to keep the records easily and easy to maintain them accurately. I set the query on each field so that the user could get the knowledge of each information about any book or anything that he needs just by putting one of the fields.
The main objectives that I mentioned in the proposed system are as follows:
To provide the record of books in the library and whole information
about them.
The system is made fast. It can do more work than a man without tiring.
It can do calculations in few minutes, which a man cannot do in hours.
It calculates the fines that are to be given by the students automatically.
Administrative personal has direct access to the database to make easy
alteration or updating.
No unauthorized person will access the database due to security feature.
Chances of errors are less.
ADVANTAGES OF COMPUTERIZATION
A number of pre-requisites are required to be satisfied for computerization. This leads to improvement in the working of the organization. Some of the advantages of the computerization are listed below:
Time saving
Control data redundancy
Control inconsistency
Increase reliability
Easy to use
User friendly
Saving of stationary
Easy to transport
Security
Accuracy
HARDWARE AND SOFTWARE SPECIFICATIONS
(A) MINIMUM SOFTWARE REQUIREMENT SPECIFICATIONS:
First of all we need software package in which we develop the proposed
system. Without this package, we can’t achieve our target. So, the software
is most essential thing to run the proposed system. The system opted for our
computers be of authorized company.
The proposed software is developed in VISUAL BASIC and
ORACLE. So, we need the following minimum software requirement for
our system to run sufficiently.
Operating System : WINDOWS ‘98’ or above
Front End : VISUAL BASIC
Back End : Ms Access
(B) MINIMUM HARDARE REQUIREMENT SPECIFICATIONS:
Pentium processor with 16MB of Ram
Floppy Drives :1.44MB
Input Devices :Keyboard, Mouse
Output Devices :Visual Display Unit, Printer
ANALYSIS
Analysis is the detailed study of various operations performed by a system and relationships within and outside the system. A key question is: what must be done to solve the problem. One aspect of the analysis is defining the boundaries of the system and determining whether or not a candidate system should consider other related system. During the analysis, data are collected on the available files, decision points and transaction handled by the present system. Some logical system models and tools are used in the analysis. Data flow diagrams, interviews, on-site observations and questionnaires are examples.
Analysis include following things:
Planning
Initial Investigation
Information Gathering
Structured Analysis
Feasibility Study
Cost/Benefit Analysis
Planning: The first step in analysis is planning. Planning is a software
project means to prepare in the customer’s terminology, concise
statement of the problem, to be solved and constrained that exists or its
solution. The definitive problem should include a description of the
present system and the goals to be achieved by the system.
Initial Investigation: The first step in initial investigation is to define the
problem that led to the user’s request. The problem must be stated clearly
understood and agreed upon by the user and the analyst. It must state the
objectives the user is trying to achieve and the result the user wants to
see. Given user identification of need, the analyst proceeds to verify the
problem by separating symptoms from causes. For this purpose the
strategies-asking, eliciting information from exiting manual system and
prototyping can be used.
Information Gathering: Information Gathering is art and science. The
analyst must know what information to gather, where to find it, how to
collect it and what to made of it. If information is gathered from sources
within the organization and from the organization’ environment. The
primary information tools are documentation, on-site observation,
interviews and questionnaires.
Structured Analysis: Structure analysis is a set of techniques and
graphical tool that allow the analyst to develop a new kind of system
specification that are easily understandable, to user, structured analysis
considered new goals and structured tool for analysis. Tools uses in
structured analysis are Data flow diagram, Data dictionary, Structured,
English, Decision tree and Decision tables.
Feasibility Study: Feasibility study describe and evaluates candidate
system and provides for the solution of the best system and meets system
performance requirements .To do a feasibility study we need to consider
the economic, technical and behavioral factors in system development.
First a project team is formed. The team developed system flow chart that
identify the characteristics of systems, evaluate the performance of each
System, weigh system performance and cost data and select the best
candidate system for the job.
Technical Feasibility: - the system is developed with in Windows &
Dos as an Operating system. The System is User Friendly; thus report
generation of data entry is made easy. Easy retrieval and access of data
is provided.
Economical Feasibility: - economical feasibility is cost – benefit
analysis. The system is economical feasible. The benefits in reducing
cost are in form cutoff, saving of paper work the other incurred to
implement the system are payment of operator, little maintenance
required for hardware & software from time to time consistency in
efficiently.
Operational Feasibility: - This system benefits only if they can be
turned into information systems that will meet the organization
operating requirements. As the system is user friendly, so the system is
also well liked and proved by the user with no difficulty at all, if the
user wants more facility, it can also be provided. After system is
implemented the user will need no changes as the system is developed
while keeping in view the requirements of the user.
The system will cause no harm to any organization; it will enhance the result in better respect. This Computerized system will avoid confusion and resistance by catching user attention.
Cost /Benefit Analysis: Cost /Benefit analysis of each alternative guide
the selection of the best system for the job. Cost and benefits may be
tangible and intangible, direct or indirect, fixed or variable. Cost
estimates also take into consideration. Hardware, personnel, facility and
supply costs for final evaluations. Cost/Benefit analysis, then identifies
the costs and benefits of the given system and categories then for
analysis. Then a method of evaluation is selected and the results are
interpreted for action.
Once analysis is completed, the analyst has a firm understanding of what is to be done. The next step is to decide how the problem might to be solved. Thus, in system design, we move from the logical to the physical aspects of life cycle.
In the analysis of my project I want through following steps:-
First of all I study what all the requirements of the library.
Then I study the existing Library system.
Studies all the components of Library management like how the
application is to be developed.
So we selected Visual Basic as it is Developing Platform as it’s more
flexible and versatile.
And after all these steps we started all the designing process.
SYSTEM DESIGN
After the system analysis phase, what follows is the system design. Once the system design part is over, the coding becomes very easy. Design is essentially the bridge between requirement specification and the final solution for satisfying the requirements. Designing the software means to plan how the various parts of the software are going to meet the desired goals. It includes design specification, input/output, files and procedures. Program construction (coding) is the main part of design.
Design is of two types:
High Level Design (Signature):
High Level design consists of the basic model that shows how the flow of control is throughout the project execution. It also contains the basic classes and functions.
Low Level Design (Algorithms and code):
Low Level Design consists of the detailed description of the classes, their functions, data types and header files.
It defines all the inner details of the project coding.
The purpose of the design phase is to plan a solution of the problem specified by the requirements document. This phase is the first step in moving from the problem domain to the solution domain. In other words, starting with what is needed; design takes us toward how to satisfy the needs. The design of a system is perhaps the most critical factor affecting the quality of the software; it has a major impact in the later phases, particularly testing and maintenance. The output of this phase is the design document.
This document is similar to a blue print or plans for the solution and is used later during implementation, testing and maintenance.
The design activity is often divided into two separate phases- system design and detailed design. System design, which is sometimes also called high-
level design, aims to identify the modules, and how they interact with each other to produce desired results.
At the end of system design all the major data structure, file formats, output formats and the major module in the system and their specification is decided. During detail design the entomological of each of the modules specified in the system design is decided. During this phase further details of the data structure and algorithm.
Design of each of the module is specified. The logic of a module is usually specified in a high-level design description language, which is independent of the target language in which the software will eventually be implemented.
In system design the focus is on identifying the modules, where as during detail design the focus is on designing the logic of each of the modules. In other words, in system design the attention is on what components are needed while in detail design how the components can be implemented in software is the issue. A design methodology is a systematic approach to create a design by application of a set of techniques and guidelines. Most methodologies focus on system design.
NEEDS:
To maintain different data files on the machines and thus save stationary
storage and lot of paper work.
To simplify the present and manual tasks.
To reduce time, manpower and paperwork.
To facilitate easy retrieval of data and information.
To update the various files after input, processing and validation.
Reports generated by the project will help management persons in
decision making.
To help all the persons in stock store by updating with latest information.
To reduce redundancy.
PROPOSED SOLUTIONS:
1. Computerized the whole system, with centralized database with
ORACLE and VIISUAL BASIC.
2. Provide extra manpower for need record keeping
It will reduce the workload.
Save Time.
3. Work in shifts.
Work is equally divided among all persons of that particular
department.
Work quality is improved.
Saves Time.
BEST SOLUTIONS:
Among all above solutions 1st solution is the best and optimal one, due to the following reasons:
Time Saving.
Saving Stationary.
Accuracy.
Easy to transport.
Security.
Considering all aspects, the introduction of the computerization is done to overcome the difficulties of the present system and provide a complete justification to computerize the existing system.
Considering the above analysis and record keeping procedures we have suggested this system. This system suggested by us is to reduce the human interaction and to facilitate record keeping processes.
IMPLEMENTATION
Implementation is the process of converting a new or revised design into operational one. It includes conversion of files, training users, creating accurate files and verifying printouts for integrity. It is the process of personnel checking out, installing the required equipment and application. Depending upon the size of the organization to use the information system and its requirements, the implementation is divided according to the requirement.
Parallel Conversion: In the parallel conversion old system and new system run together in parallel unit all the bugs in the new system have been identified and eliminated.We can adopt this category while also working on the manual system, so that there should be minimum chance of data loss and safe data storage is there. This strategy is quite safe, but somewhat expensive because both the systems will run simultaneously.
Direct Cutover: With this strategy, old system is replaced with the new one directly. We can also direct implementation replacing manual system. This approach is risky because in case of system stops working, data may be lost.
Pilot Study: With this approach one department or unit is tested before installing whole project throughout the organization.
Phased Conversion: The new system is slowly phased into its operational environment by replacing the part of the old system with the part of the new one system.
TESTING TECHNIQUES
Testing is the process of evaluating the software with an intention of finding errors. The software tested is executed with the step of sample test cases and outputs are then observed to determine whether the performance of the software adheres to as expected. System is tested for correct outputs, online responses and volume of data. It makes a logical assumption that if all parts of the system are correct, the goal will be successfully achieved. The success of test in revealing errors depends critically on the different cases in software systems. The testing is used later on during maintenance also. This project has been tested for various test cases and the result or the outputs have been checked for validation.
Various testing operations were performed to find out errors in the system and to reduce the defects.
Unit Testing: In the three major parts. Each part is checked
independently. Making whole project into three independent units are
checked efficiently.
System Testing: After the unit testing the three units are combined
together under one system and after combining the units a whole system
project testing was performed.
Acceptance Testing: After passing Unit Testing and System Testing
project is adjusted and checked so that it can be accepted by the user, so
in the last acceptance testing was performed with the various data.
SYSTEM MAINTENANCE
Programmers and analysts spend more time in maintaining programs and writing them. The problems in maintaining occur largely because software is handmade product. Poor documentation makes maintenance of the programs even more difficult. The more carefully is the system throughout and developed, with attention paid to external influence over a reasonable lifetime, the lesser is the maintenance required.
INTODUCTION TO MS ACCESS
A database is a collection of coherent, meaningful data. A data base
management system is the software system that allows users to define, create
and maintain a database and provides controlled access to the data. It is
basically a collection of programs that enable users to store, modify and
extract information from the database. It provides services for accessing a
database, while maintaining all the features of data. Example: dbase,
FoxPro, Oracle.
Features
Productivity tool: The DBMS act as productivity tool of a programmer;
it gives the programmer the capacity to work with database enhancing his
productivity. As DBMS takes care of the Database management, the
programmer now need not bother about the handling of database, can
now in turn use his time for other productive activities.
User Interface: DBMS provides a programmer with a good user
interface, which enables him to interact with database very easily. The
DBMS itself can be taken as an interface between the programmer and
the database.
Database Support and Structure: DBMS provides powerful database
support and has a powerful structure. The data is fit into the structure, so
that it does not pose any threats and problems to the data organization.
Easy to work with: DBMS provides interfaces, which are quite easy to
work. One need not do much of programming. The language syntax is
very easy; it is usually simple English like which can be learnt and
remembered easily.
Advanced Data Manipulation: All data manipulations like adding,
inserting, updating etc. of record/data is provided for. Apart from these
various mechanisms are available which take care about the security
aspect of data.
Data Independence: This is one of the excellent features of DBMS. This
makes the data to stand on its own, without depending on anything may it
be hardware or the access strategy. The Data Independence is further
classified into
Physical data independence
Logical data independence
Advantages of DBMS
Reduction of Redundancies: Centralized control of data by the DBA
avoids unnecessary duplication of data and effectively reduces the total
amount of data storage required. It also eliminates the extra processing
necessary to trace the required data in large mass of data. Another
advantage of avoiding the duplication is the elimination of
inconsistencies that tend to be present in redundant data files.
Shared Data: A database allows the sharing of data under its control by
any number of applications programs or users.
Integrity: Centralized control can also ensure that adequate checks are
incorporated in the DBMS to provide data integrity. Data integrity means
that the data contained in the database is both accurate and consistent.
Therefore, data values being entered for storage could be checked to
ensure that they fall within the specified range and are of the correct
format.
Security: In order to ensure that the database is accessed through proper
channels, various security measures are applied in DBMS. Rules can be
established to restrict the type of access to the information stored in the
database.
Data Independence: It is considered from two points of views: physical
data independence and logical data independence. Physical data
independence allows changes in the physical storage devices or
organization of the files to be made without requiring any changes in the
external schema. Logical data independence implies that application
programs need not to be changed if fields are added to an existing record;
nor do they have to be changed if fields not used by application programs
are deleted. It implies that conceptual schema can change without
affecting external schema.
Disadvantages of DBMS
Complexity of backup and recovery.
Expensive hardware, software and transformation cost requirement.
Increased data security requirements.
Failure and down time problems associated with the centralized database.
Introduction to SQL
Structured query language (SQL) is a language that provides an interface to
relational database systems. IBM developed SQL in the 1970s. In common
usage SQL also encompasses DML (Data Manipulation Language), for
INSERTs, UPDATEs, DELETEs and DDL (Data definition Language), used
for creating and modifying tables and other database structures.
The development of SQL is governed by standards. The ANSI is an
organization that approves certain standards in many different industries. It
was originally approved in 1986 based on IBM’s implementation. In 1987,
the International Standards Organization (ISO) accepted the ANSI SQL
standard as the international standard. The standard was revised again in
1992 and was called SQL-92. The newest standard is now called SQL-99, it
is also referred to as SQL3. SQL3 supports object extensions and are
partially implemented on Oracle8 and 9.
When an SQL statement is entered, it is stored in a part of memory called
the SQL buffer and remains their until a new SQL statement is entered..
Features of SQL
A range of users can use SQL, including those with little or no programming
experience.
It is a non-procedural language.
It reduces the amount of time required for creating and maintaining systems.
It is an English-like language.
Components of SQL
DDL (Data Definition Language): - It is a set of SQL commands used
to create, modify and delete database structures but not data. These
commands are normally not used by a general user, who should be
accessing the database via an application. They are normally used by the
DBA to limited extent, database designer or an application developer.
Every DDL commands implicitly issues a COMMIT command to the
database.
DML (Data Manipulation Language): - It is the area of SQL that
allows changing data within the database.
DCL (Data Control Language): - It is the component of SQL statement
that control access to data and to the database.
DQL (Data Query Language): - It is the component of SQL statement
that allows getting data from the database and imposing ordering upon it.
It includes the SELECT statement. When a SELECT is fired against a
table or tables the result is compiled into further temporary table, which
is displayed or perhaps received by a program i.e. a front-end.
Examples of DDL, DML and DCL commands
DDL: Data Definition Language statements
Examples:
CREATE To create object in the data base
ALTER Alters the structure of the data base
DROP Delete object from the database.
TRUNCATE Remove all the records from the table, including all spaces
allocated for the records are removed.
COMMENT Add comments to the data dictionary.
GRANT Gives users access privileges to the database
REVOKE Withdraw access privilege gives with GRANT command.
DML: Data manipulation language statements
Examples:
INSERT Data into a table
UPDATE Updates existing data within a table
DELETE Deletes all the records from a table, the space for the records
remain
CALL Call a PL\SQL or Java subprogram
EXPLAIN PLAN Explain access path to data
LOCK TABLE Control concurrency
DCL: Data Control Language statements
Examples:
COMMIT Save work done
SAVEPOINT Identify a point in a transaction to which you can later roll
back
ROLLBACK Restore database to original since the last COMMIT
SET TRANSACTION Change transaction options like what rollback
segment to use
GRANT/REVOKE Grant or take back permission to or from the oracle
users
DQL: Data Query Language statements
Examples:
SELECT Retrieve data from the a database
Description of commands
The CREATE TABLE command
The CREATE TABLE command defines each column of the table uniquely.
Each column has a minimum of three attributes, a name, datatype and size.
Each table column definition is a single clause in the create table syntax. A
comma separates each table column definition from other. Finally, the SQL
statement is terminated with semicolon.
Syntax:
CREATE TABLE<Table Name>
(<Column Name1><data type>(<size>),<column name2><data type
(<size>));
Example:
CREATE TABLE branch_mstr ( branch_no varchar2(10), name
varchar2(25));
Output:
Table created
Inserting data into tables:
Once a table is created, then load this table with data to be manipulated later.
When inserting a single row of data into the table, the insert operation:
Creates a new row in the database table
Loads the values passed into the columns specified.
Syntax:
INSERT INTO <table name>(<columnname1>,<columnname2>)
VALUES(<expression>,<expression2>);
Example:
Insert into branch_mstr ( branch_no, name) values ( ‘B1’,’VileParle’);
Output:
1 row created
Viewing data in the tables:
The SELECT SQL verb is used to retrieve rows selected from one or more
tables
all rows and all columns.
Syntax:
SELECT <column name> TO<columnname1> FROM Table name;
Syntax: SELECT *from <Table name>;
Example:
Select emp_no, fname, mname, lname from emp_mstr;
Output:
Emp_no fname mname lname
E1 Ivan Nelson Bayross
E2 Amit Desai
E3 Maya Mahima Joshi
ELIMINATING DUPLICATION ROWS WHEN USING A SELECT
STATEMENT
A table could hold duplicate rows. In such a case to view only unique rows
the DISTINCT clause can only be used with select statements.
Syntax:
SELECT DISTINCT <COLUMNNAME1>, <COLUMNNAME2> FROM
<Table name>;
Example:
Select DISTINCT Occup from cust_mstr;
Output:
Occup
Business
Community Welfare
Executive
Information Technology
4 rows selected
The select distinct * SQL syntax scans through entire rows, and eliminates
rows that have exactly the same contents in each column.
Syntax:
SELECT DISTINCT * FROM <Tablename>;
Example:
SELECT DISTINCT * FROM branch_mstr;
Output:
Branch_no Name
B1 Vile Parle (HO )
B2 Andheri
B3 Churchgate
B4 Sion
4 rows selected
Sorting data in a table:
Oracle allows data from a table to be viewed in a sorted order. The rows
retrieved from a table will be sorted in either ascending or descending order
depending on the condition specified in the SELECT sentence.
Syntax:
SELECT * FROM <Tablename>
ORDER BY <columnname1>, <columnname2><[sort order]>;
CREATE VIEW vw_customers AS SELECT * FROM cust_mstr;
Renaming the Columns of A View
Example:
CREATE VIEW vw_transactions AS
SELECT acct_no “Account No.”, type, dr_cr “Mode”, amt “Amount”
FROM trans_mstr;
Selecting a Data from a View
Syntax
SELECT <column name1>, <column name2> FROM <view name>;
Example
SELECT FNAME, LNAME, DEPT FROM vw_Employees
WHERE DEPT IN (‘Marketing’, ‘Loans And Financing’);
Updateable views:
Views can also be used for data manipulation. Views on which data
manipulation can be done are called updateable views. When you give an
updateable view name in the update, insert or delete SQL statement,
modification to data will be passed to the underlying table.
For a view to be updateable it should meet the following criteria:
If the user wants to insert record with the help of a view the primary key
column and the entire not null column must be included in the view.
The user can UPDATE, DELETE records with the help of a view even if
the PRIMARY KEY column and NOT NULL column are excluded from
the view definition.
Syntax for creating and updateable view:
CREATE VIEW ww_client AS
SELECT client_no, name, addres1, bal_due
FROM client_master;
A View can be created from more than one table. For the purpose of
creating the view these tables will be linked by a join condition specified
in the where the clause of the view definition.
Views defined from multiple tables:
If a view is created from multiple tables, which were created without
using a ‘referencing clause’ then though the PRIMARY KEY column as
well as the NOT NULL columns are included in the view definition the
view behavior will be as follows:
The INSERT, UPDATE or DELETE operation is not allowed.
If a view is created from multiple tables, which were created using a
‘referencing clause’ then though the PRIMARY KEY column as well as
the NOT NULL columns are included in the view definition the view
behavior will be as follows:
An INSERT operation is not allowed.
The DELETE or MODIFY operations do no effect the master table
The view can be used to MODIFY the columns of the detail table
included in the view.
If a DELETE operation is executed on the view the corresponding
records form the delete table will be deleting.
Example:
Table Name: BRANCH_MSTR
Column
Name
Data
Type
Si
z
e
Attributes
BRANCH
_NO
VarC
har2
1
0
Primary Key/ First letter
must be ‘B’
NAME VarC
har2
2
5
Table Name: ADDR_DTLS
Column
Name
Data-
Type
S
i
z
e
Attributes
ADDR_N Number 6 Primary Key
O
CODE_NO VarChar
2
1
0
Foreign Key references
BRANCH_NO of the
BRANCH_MSTR table.
ADDR_TY
PE
VarChar
2
1 Can hold the values: H for Head
Office or B for Branch
ADDR1 VarChar
2
5
0
ADDR2 VarChar
2
5
0
CITY VarChar
2
2
5
STATE VarChar
2
2
5
PINCODE VarChar
2
6
Syntax for creating a Master/Detail View
CREATE VIEW vw_Branch AS
SELECT FROM BRANCH_NO, NAME, ADDR_TYPE, ADDR1,
ADDR2, CITY, STATE, PINCODE FROM BRANCH_MSTR,
ADDR_DTS
WHERE ADDR_DTLS.CODE_NO= BRANCH_MSTR.BRANCH_NO;
Destroying a view
The DROP VIEW command is used to remove a view from the database.
Syntax:
DROP VIEW viewname;
Example:
Remove the view ww_clientadmin from the database.
DROP VIEW ww_clientad
Index
An Index is an ordered list of the contents of the column or group of
columns of the table. Indexing involves forming a two dimensional matrix
completely independent of the table on which the index is being created.
This two-dimensional matrix will have a single column, which will hold
sorted data, extracted from the table columns on which the index is created.
Another column called the address field identifies the location of the record
in the Oracle database.
Data retrieval from the table using an index is much faster than data retrieval
from the table where indexes are not defined.
Duplicate/Unique Index
Oracle allows the creation of two types of indexes. These are:
Indexes that allow duplicate values for the indexed columns i.e. Duplicate Index
Indexes that deny duplicate values for the indexed columns i.e. Unique Index
Creation of an Index
An index can be created on one or more columns. Based on the number of
columns included in the index, an index can be:
Simple Index
Complex Index
Creating Simple Index
An index created on a single column of a table is called a Simple Index. The
syntax for simple index that allows duplicate values is as described.
Syntax:
CREATE INDEX <Index Name> ON <Table Name> (<Column Name>);
Example:
Create a simple index on VERI_EMP_NO column of the ACCT_MSTR
table.
Solution:
CREATE INDEX idxVeriEmpNo ON ACCT_MSTR (VERI_EMP_NO);
Output:
Index created.
Creating Composite Index
An index created on more than one column is called a Composite Index. The
syntax for the creating a composite index that allows duplicate values is:
Syntax:
CREATE INDEX <Index Name>
ON <Table Name> (<ColumnName1>, <ColumnName2>);
Example:
Create a composite index on the TRANS_MSTR table on columns
TRANS_NO and ACCT_NO
Solution:
CREATE INDEX idxTransAcctNo ON TRANS_MSTR (TRANS_NO,
ACCT_NO);
Output:
Index created
Creation of Unique Index
A unique index can also be created on one or more columns. If an index is
created on a single column, it is called a Simple Unique Index. The syntax
for creating a simple unique index is as follows:
Syntax:
CREATE UNIQUE INDEX <Index Name> ON <Table Name> (<Column
Name>);
If an index is created on more than one column, it is called a Composite
Unique Index. The syntax for creating a composite unique index is as
follows:
Syntax:
CREATE UNIQUE INDEX <Index Name>
ON <Table Name> (<Column Name>, <Column Name>);
Example:
Create a unique index on CUST_NO column of the CUST_MSTR table.
Solution:
CREATE UNIQUE INDEX idx_CustNo ON CUST_MSTR (CUST_NO);
Output:
Index created
Dropping Indexes
Indexes associated with the tables can be removed by using the DROP
INDEX command.
Syntax:
DROP INDEX idx_CustNo;
Sequences
Oracle provides an object called sequence that can generate numeric value.
The value generated can have a maximum of 38 digits. A sequence can be
defined to
Generate numbers in ascending or descending
Provide intervals between number.
Caching of sequence number in memory etc.
A sequence is an independent object and can be used with any table that
requires its output.
Creating Sequences:
The minimum information required for generating numbers using a sequence
is:
The starting number
The maximum number that can be generated by a sequence
The increment value for generating the next number
This information is provided to Oracle at the time of the sequence
creation. The SQL statement used for creating a sequence is:
Syntax:
CREATING SEQUENCE sequence_name
Example:
CREATE SEQUENCE order_seq
INCREMENT BY1
STAER WITH1
MINVALUE1
MAXVALUE9999
CYCLE;
Alter a sequence
A sequence once created can be altered. This is achieved by using
ALTER SEQUENCE statement.
Syntax:
ALTER SEQUENCE sequence_name
Example:
ALTER SEQUENCE order_seq
INCREMENT BY 2
CACHE 30;
Dropping a sequence
The DROP SEQUENCE command is used to remove the sequence from
the data base.
Syntax:
DROP SEQUENCE sequence_name;
Example
DROP SEQUENCE order_seq;
INTRODUCTION TO VISUAL BASIC
VISUAL BASIC:
Visual Basic was developed from the BASIC programming language. In 1970 Microsoft started developing ROM based interpreted BASIC for the early microprocessor based computers.
Visual Basic is that ideal programming language for developing sophisticated professional application for Microsoft Windows. It makes use of graphical user interface for creating robust and powerful applications.
Coding in GUI is different from traditional, Linear programming methods where the user is guided through a linear path of execution and is limited to small set of operations. In GUI environment, the number of operations open to user is much greater, allowing more freedom to user and developer.
Reasons for using Visual Basic as front end tool:
Its features such as easier comprehension, user friendly, faster
application development etc.
Simple
Powerful
Windows native development
Rapid application development
Provision for wizards
There is no restriction on the no. of controls that can be placed on the
form.
A programmer need not write code to display the required component.
The component can be moved, resized and even deleted, if so
required.
Some Visual Interface Components:
Window:
A window sometimes also called a form, is the most important of all the visual interface components. The window is the base for a user interface of application. All the components that make a user interface are placed in the window and can’t exist independent of the window.
When the application starts it opens a window. Once the window is loaded into the memory, all the components contained in it come into existence and can be accessed.
The Form:
The window called a form in visual basic. The form is a main part of the user interface. It is the base on which the user interface is built.
Form property:- Some of the important properties are listed below:-
Caption:- The text that appears on the title bar of the form.
Name:- Text used in the code to identify the form. By default the form
name is form1.
Form methods:-
Load:- The statement initialize and load the form into the memory
without displaying it on the screen.
Load form1
Unload:- Unload removes a form from memory.
Unload me
Hide:- The hide method removes a form from the screen.
Form1.hide
Show:- The show method loads a form into the memory if not loaded
already and display it on the screen.
Form events:-
Form events are generally triggered in the following order:-
Initialize:- The initialize event is triggered before the form is loaded or
displayed it. It is generally used to prepare an application for use.
Load:- The load event perform action that are required before a form is
displayed. It occurs each time that a form is loaded into the memory.
Activate/Deactivate:- An activate event is triggered when a form receives
focus from another form in the same project and the deactivate event is
fired after the lost focus event that is, after a form loses focus to another
form.
Query Unload:- The query unload event determines how a form was
closed.
Terminate:- Terminate event is triggered when all instances of a form are
removed from memory. It occurs after the unload event.
Set form1= nothing
Buttons:
The button, also reffered to as command button or push button, is one of the
most popular user interface components.
Button Properties:
Caption:- the text that appears on the command button.
Picture:- Sets the graphic to be displayed on the image button.
Enabled:- sets a value that determines whether a form or control can
respond to the user generated events.
The button methods:-
Move
Button
The button events:-
Click
List Box:-
List box are used to present the user with the possible list options. The user can select one or more of the listed options by default the choice is displayed vertically in a single column, although we can set up multiple columns as well.
List Box Properties:
List Index:- The list index started with 0 for the first item in the list box.
Sorted:- It is used to display the items in the sorted order.
List Box
Multiselect:- It is used to specify if the user can select multiple items in
the list.
List count:- It is used to return the no. of items in a list box.
List box methods:-
Add item:- This method adds the specified items to the list box.
Remove item:- It is used to delete the items from the list.
Setfocus:- It is used to make the list box the current active element.
List box event:-
Click:- The user click on the list box.
Scroll:- the user scroll through the list in the list box.
Combo box or drop down List box:-
A Combo box control combines the feature of a text box and a list box. This control allows the user to select an item either by typing text into the combo box or by selecting it from the list.
Combo box properties:-
Style:- There are two combo box styles.
Simple combo box:- Specifically a simple Combo box in which the list
is displayed at all times.
Drop down combo box:- The user can either enter text directly or click
the combo box list.
Locked:- It is used to specify whether the user can enter a value in the
text box section of the control.
Combo Box
Combo box methods:-
Click:- The user click on the Combo box.
Scroll:- The user scroll through the list in the combo box.
Change:- It occurs when the user changes the text in the textbox portion
of the combo box.
Drop down:-It occurs when the user clicks on the arrow to display the
list.
The radio button or option button:
The radio button also referred to as option buttons, are used when the use can select one and only one of the multiple options.
The option button properties:-
Caption:- The text that appears next to the option button.
Value:- This property specify whether the option button is selected.
Enabled:- sets a value that determines whether a form or control can
respond to the user generated events.
The option button methods:-
Move:- Moves a control on the form.
The option button events:-
Click:- Occurs when the user clicks on the option button.
The frame Control:-
The frame control provides an identifiable grouping for controls.
Radio Button
The frame properties:-
Caption:- The text that appears on the screen.
The frame methods:-
Move:- Moves the frame control along with the controls placed within it.
Drag:- Begins, ends or cancels a drag operation of the control.
The frame events:-
Click:- Occurs when the user clicks on the frame control.
The check box:-
A checkbox indicates whether a particular condition is on or off. Checkbox are used in an application to give users true/false or yes/no options. Check
Frame
box controls are used to display multiple choices from which the user can select one or more.
The Check box properties:-
Caption:- The text that appears next to the check box.
Value:- This property specifies whether the check box is selected.
The Check box methods:-
Move
Drag
The Check box events:-
Click:- occurs when the user ticks on the check box.
The Scroll bars:-
Check Box
Scroll bars provides easy navigation through a long list of items or a large amount of information. Scroll bars are actually graphical representation of numeric values. The values can be range from-32768 to 32767 and the minimum value to 0.
Visual basic allows us to create two types of scroll bars:-
Horizontal and vertical:- Horizontal scroll bars scroll from left to right and vertical scroll bars scroll up and down.
The scroll bar properties:-
Min:- An integer which defines the smallest value for a scroll bar. The
possible values are from –32768 to 32767.
Max:- An integer which defines the largest value for a scroll bar.
Value:- A numeric value determined by the current position of the scroll
box within the scroll bar. The value depends on the value of Max and
Min properties.
The Scroll bar methods:-
Scroll Bar
Move
The Scroll bar events:-
Scroll:- Occurs when the scroll box on a scroll bar control is repositioned
or scrolled horizontally or vertically.
Change:- Occurs when the user scrolls through the scroll bar.
The text box:-
A text box also called an edit field or edit control. It is used to display text or to accept user input.
The text box properties:-
Text Box
Text:- Text entered into the text box control.
Multiline:- Sets a value indicating whether a text box control can accept
and display multiple lines of text.
Maxlength:- Specifies the maximum number of characters that can be
entered.
Passwordchar:- This property hides or masks the characters entered into
the text box.
Locked:- The locked property determines whether a user can edit a text if
this property is set to true the text box is read only that is the user cannot
edit text.
The text box methods:-
The below methods are working same as list box:
Move
Drag’
Setfocus
The text box events:-
Key press:- Occurs when the user presses and releases the key.
Click:- Occurs when the user clicks in the text box.
Change:- Occurs when the text in the textbox changes.
Lostfocus:- Occurs when a control loses the focus
The button:-
A button is a control which allows the user to click on it to perform an action. Visual basic allows us to create two types of buttons:
Command button and Image buttons
Command buttons are also called push button and allows the usr to click them to perform the required action. Image buttons respectively as displayed on the visual basic toolbox.
The button properties:-
Caption:- the text that appears on the command button.
Picture:- Sets the graphic to be displayed on the image button.
Enabled:- sets a value that determines whether a form or control can
respond to the user generated events.
The button methods:-
Image Button
Move
The button events:-
Click
The label:-
The label is the control used to place text in a form.
The label properties:-
Caption:- This property holds the text to be displayed by the control.
Autosize:- Sets a value that determines whether a control automatically
resized to display its entire contents.
Word-wrap:- When set false, this property will ensure that the text of the
label is displayed as a single line
The label methods:-
Label
Move:- used to move the label.
The label events:-
Click:- The user click with a mouse on the label.
Menus:-
Application can perform a number of tasks. For effective use of the application it must:
Inform the users of the tasks that are available.
Give the users the means to specify the task that is to be performed.
The application does this via a “Menu”.
Menus provide a convenient and consistent way to group commands and an easy way for users to access them. It allows an application to present the user with a means of initiating different actions. A menu bar appears below the title bar.
Designing a Menu:-
In visual basic we use the menu editor to design a menu. While most menu control properties can be set using the menu editor, all menu properties are available in the properties window. The property important to menu controls are:-
Menu Bar
Caption:- This is the text that appears on the control.
Name:- This the name we use to reference the menu control from code.
Shortcut:- Shortcut keys run the menu item immediately when pressed.
Checked:- Sets a value that determined whether a check mark is
displayed next to the menu item.
Enabled:- Sets a value that determined whether a menu item can respond
to events.
Pop-up Menus:-
A pop up menu is a menu displayed at the cursor location when the user clicks the right mouse button. The code of the pop up menu is added in the mouse down event of a form.
Tool Bar:-
The tool bar is situated, typically, immediately below the menu bar. The buttons in a tool bar are analogous to the items in a menu. Tool bars also be made to display tool tip.
Tool bar properties:
Style:- It determines the appearance of the control.
Text alignment:- It determines the position of text relative to the button.
Tool Tip Text:- Sets a tool tip.
Tool Bar
The tool bar events:-
Button click:- When the user clicks on a button object in a tool bar control.
The tool bar methods:
Move
Drag
Status bar:-
A status bar is a window which is usually displayed at the bottom of a form. It inform the user of the status of an application.
Status Bar
Status bar properties:-
Panel:- refers to a collection of panel objective.
Style:- sets the style of the status bar control.
Tool tip text:- Sets the tool tip.
Status bar methods:-
Move
Drag
Status bar events:-
Panelclick & Paneldblclick
Dialog boxes:-
A dialog box is a temporary window that contains controls. We can use it.
To display information and messages for the user.
As a means of accepting user input for a specified action.
Features of a dialog box:-
A dialog box does not have a menu.
A dialog box cannot be resized.
Types of dialog box:-
Modal dialog box:- A modal dialog box will not let the user perform any
action while it is on display. For example Print dialog, File Open dialog
box.
Modeless:- Modeless dialog box let the user shift the attention between
the dialog box and another form without having to close the dialog box.
For example Find dialog box.
Common dialogs:- A common dialog box is a system defined dialog box
that standardizes how users perform complex operations that are common
to most applications. The color open, save as and print are some
examples of common dialog boxes.
Custom dialog boxes:- These are dialog boxes designed to meet the
requirements of the application and are designed by the programmer.
Data Controls:-
The data control of visual basic allows us to access and manipulate databases.
Using a data control:-
By setting the properties of the data control we watch the data control to a specific database and the table in it. Data control itself does not display data. It only conducts the flow of information back and forth between our application and database.
Controls that can work with the data control to access the data are said to be data aware or bound and the process of attaching a data aware to the data control is called binding. Some examples of bound controls are Picture, label, Text box, List box, Check box. The data control enables us to move from record to record and to display and manipulate the data from the records in bound controls.
Record set:- A record set represents the records in a table or the records that results from running a query.
Data control properties:-
Connect:- sets a value that provides information about the source of a
database.
Database name:- Sets the name and location of the source of data for a
data control.
Record source:- Sets the underlying table.
Recordset type:- Sets a value indicating the type of Recordset we want
the data control to create. It has the following three types of recodsets:
Dynaset-type:- A dynamic set of records can add, change or delete
records from a dynamic set type recordset and the changes will be
reflected in the underlying tables.
Table-type:- A set of records that represents a single database table
that can be used to add, change or delete records.
Snapshot-type:- A copy of a set of records that can be used to find
data or generate reports, but cannot be updated.
Data control events:-
Validity:- It occurs when a different record becomes the current record.
Data control methods:-
Move
Drag
Bound control properties:-
Datafield:- specifies the name of a datafield in the record set created by
the data control.
Data source:- specifies the name of the data control to which the control
is bound.
Active data object:-
ADO is an interface OLEDB. Introduction in version 6 of visual basic. This is Microsoft newest data access technology and provides access to almost any data stored in different formats. ADO is a replacement for the old DAO and RDO gives us features not found in either.
Objects of ADO:-
Connection:- The connection object creates a connection between an
application and the data source.
Recordset:- The recordset object is used to access records returned from
a query.
Command:- A command object is used to query a database and access
the records that are returned from the database.
How to create a connection:-
To create a connection objects we need to set the connection string and the connection timeout property.
We establish the physical connection to a data source using the open method of connection object.
Methods of recordset:-
Movefirst:- takes the user to first record of the recordset.
Movenext:- takes the user to next record of the recordset.
Movelast:- takes the user to last record of the recordset.
Moveprevious:- Moves the user to previous record of the recordset.
Single document interface:-
In a SDI application all the windows can be moved anywhere on the screen. SDI are used by application where the interface of the application can remain constant throughout in SDI the user allows to create or use one file at a time.
Drawbacks of SDI:-
It allows one file to be opened at a time.
If the user do work on multiple files he has to open multiple files.
Multiple document interface:-
MDI uses an outer frame window to hold inner windows. Inner windows present the interface. An application that provides varied functionality and requires a different interface each time.
Components of MDI interface:-
MDI frame:- the outer or the container window.
MDI child:- the inner window which represents the interface.
Characteristics of MDI components:-
When an application with a MDI is started, it is the MDI frame that gets
displayed.
It acts as a container for all other windows in the application.
The each inner window is referred to as a MDI child.
There can be multiple child windows opened at a time.
None of the MDI child window can be moved out of the MDI frame.
Code of Loin Form:-
Option Explicit
Public LoginSucceeded As Boolean
Private Sub cmdCancel_Click ()
LoginSucceeded = False
Me.Hide
Unload mdi_start
End
End Sub
Private Sub cmdOK_Click ()
'check for correct password
If (txtUserName = "shaan" And txtpassword = "bawa") Or (txtUserName = "sapna" And txtpassword = "sharma") Then
Private Declare Function OSWinHelp% Lib "User32" Alias "WinHelpA" (ByVal hWnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub MDIForm_Load()
Me.Show
Me.Enabled = False
'setting toolbar images
With Toolbar2
Set .ImageList = ImageList1
.Buttons(2).Image = 1
.Buttons(3).Image = 7
.Buttons(5).Image = 5
.Buttons(6).Image = 6
.Buttons(7).Image = 14
.Buttons(8).Image = 2
.Buttons(9).Image = 3
.Buttons(11).Image = 10
.Buttons(13).Image = 8
.Buttons(14).Image = 9
.Buttons(16).Image = 12
.Buttons(17).Image = 13
.Buttons(19).Image = 4
.Buttons(20).Image = 11
End With
sbStatusBar.Panels(3).Text = "Login"
End Sub
Private Sub MDIForm_Unload(Cancel As Integer)
On Error Resume Next
If MsgBox("Are You Sure you want to Quit ?", vbExclamation + vbOKCancel, "Library Management System") = vbOK Then
Unload frmLogin
Else
Cancel = True
End If
End Sub
Private Sub mnu_cascade_Click()
Me.Arrange vbCascade
End Sub
Private Sub mnu_hoizontal_Click()
Me.Arrange vbTileHorizontal
End Sub
Private Sub mnu_vertical_Click()
Me.Arrange vbTileVertical
End Sub
Private Sub sbStatusBar_PanelClick(ByVal Panel As MSComctlLib.Panel)
If MsgBox("Execution of command will delete current Datarecord,Are you sure you wan't to delete Datarecord ?", vbYesNo + vbExclamation, "Confirm Delete") = vbYes Then
MsgBox "Member account cannot be deleeted because member has not returned books.", vbInformation, "Books not returned"
temp.Close
Exit Sub
End If
temp.Close
If MsgBox("Execution of command will delete current Datarecord,Are you sure you wan't to delete Datarecord ?", vbYesNo + vbExclamation, "Confirm Delete") = vbYes Then
Memrecordset.Open "select Address,Birthdate,Bookinhand,Deposite,Doexpire,Dojoin,Email,Fname,Lname,Memid,Noted,Phone,Sex from Member Order by Memid", Memconnection, adOpenStatic, adLockOptimistic
Set DataGrid1.DataSource = Memrecordset
DataGrid1.ReBind
bookshow = False
lodbook = False
Set Flexgridset = New ADODB.Recordset
Set temp = New ADODB.Recordset
Call showdata
Call setbutton(True)
msk_bdate.Enabled = False
msk_expr.Enabled = False
msk_join.Enabled = False
cmd_book1.Visible = False
Exit Sub
errlable:
MsgBox Err.Number & Err.Description
End Sub
Private Sub loadbook()
If Memrecordset.EOF = False And Memrecordset.BOF = False Then
again:
If (lodbook = False) Then
Flexgridset.Open "select Author1,Author2,Author3,Bookid,Edition,ISBNNumber,Pages,Price,Publication,Subject,Title,Avano,Issno,Totalno from Book where Bookid in(select Bookid from Issue where Memid=" & Trim(txt_memid.Text) & ")", Memconnection, adOpenStatic, adLockOptimistic
lodbook = True
Set Datagrid.DataSource = Flexgridset
Datagrid.ReBind
Else
Flexgridset.Close
lodbook = False
GoTo again
End If
End If
End Sub
Private Sub locate()
lbl_total.Caption = Memrecordset.RecordCount
lbl_rec.Caption = Memrecordset.AbsolutePosition
End Sub
Private Sub showdata()
If Memrecordset.EOF = False And Memrecordset.BOF = False Then
i = MsgBox("Members Total fine amount Rs : " & amount & " as per Rs : " & fratepday & " per Day charge.click yes if paying or click No if fine is collected from Members Deposite.", vbYesNoCancel + vbExclamation, "Confirm Data")
Select Case i
Case vbYes
Case vbNo
'transfer from deposite
str = "UPDATE Member SET Deposite = Deposite-" & CDbl(amount) & " WHERE Memid= " & Trim(txt_memid.Text)
Returnconnection.Execute str
MsgBox "The fine amount is transfer from members deposite.", vbInformation, "Fine"
Case vbCancel
'cancelling process of making entry
Call setlock(True)
Call setbutton(True)
MsgBox "Return process was cancelled.No more entry Updated.", vbInformation, "Fine"
Exit Sub
End Select
'make entry in fine table
str = "INSERT INTO Fine (Areturndate,Bookid,Fine,Memid)"
MsgBox "Fine amount will be decided by itself.", vbInformation, "Self field propery"
End Sub
Code of Search Form:-
Dim fnd As String
Dim mflag As Boolean
Dim bflag As Boolean
Dim conn As ADODB.Connection
Dim MR As ADODB.Recordset
Dim BR As ADODB.Recordset
Private Sub cmb_bfield_click()
If (cmb_bfield.Text = "All") Then
txt_bvalue.Enabled = False
Else
txt_bvalue.Enabled = True
End If
lbl_status.Caption = " Search for book's Record field."
txt_bvalue.Text = ""
End Sub
Private Sub cmb_mfield_click()
If (cmb_mfield.Text = "All") Then
txt_mvalue.Enabled = False
Else
txt_mvalue.Enabled = True
End If
txt_mvalue.Text = ""
lbl_status.Caption = " Search for Member's Record field."
End Sub
Private Sub cmd_bsearch_Click()
On eror GoTo errlable:
'write code for validity
again:
bpbar.Value = 0
If (cmb_bfield.Text = "All" Or txt_bvalue.Text = "") Then
fnd = "select Author1,Author2,Author3,Avano,Bookid,Edition,ISBNNumber,Issno,Pages,Price,Publication,Subject,Title,Totalno from Book order by Bookid"
lbl_status.Caption = " Search for Book's Record field Alldata."
bpbar.Value = 30
ElseIf (cmb_bfield.Text = "Author") Then
fnd = "select Author1,Author2,Author3,Avano,Bookid,Edition,ISBNNumber,Issno,Pages,Price,Publication,Subject,Title,Totalno from Book where Author1 like'" & Trim(txt_bvalue.Text) & "%' or Author2 like'" & Trim(txt_bvalue.Text) & "%' or Author3 like'" & Trim(txt_bvalue.Text) & "%'"
lbl_status.Caption = " Search for Book's Record field Author."
bpbar.Value = 30
ElseIf (cmb_bfield.Text = "Price" Or cmb_bfield.Text = "Pages" Or cmb_bfield.Text = "Bookid") Then
If IsNumeric(txt_bvalue.Text) Then
fnd = "select Author1,Author2,Author3,Avano,Bookid,Edition,ISBNNumber,Issno,Pages,Price,Publication,Subject,Title,Totalno from Book where " & Trim(cmb_bfield) & " = " & Trim(txt_bvalue)
lbl_status.Caption = " Search for Book's Record field " & Trim(cmb_bfield.Text) & " of book."
bpbar.Value = 30
Else
txt_bvalue.Text = ""
Exit Sub
End If
Else
fnd = "select Author1,Author2,Author3,Avano,Bookid,Edition,ISBNNumber,Issno,Pages,Price,Publication,Subject,Title,Totalno from Book where " & Trim(cmb_bfield) & " like '" & Trim(txt_bvalue) & "%'"
lbl_status.Caption = " Search for Book's Record field " & Trim(cmb_bfield.Text) & " of book."
lbl_status.Caption = " Choose the options for Datamember,Field and values for search."
Exit Sub
errlable:
MsgBox Err.Number & " " & Err.Description
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
End Sub
Private Sub SSTab1_DblClick()
End Sub
Private Sub txt_msearch_Click()
'write a code validity
On Error GoTo errlable
again:
mpbar.Value = 0
lbl_status.Caption = " Search for Member's Record field " & Trim(cmb_mfield.Text) & " of Member."
If (cmb_mfield.Text = "All" Or txt_mvalue.Text = "") Then
fnd = "select Address,Birthdate,Bookinhand,Deposite,Doexpire,Dojoin,Email,Fname,Lname,Memid,Noted,Phone,Sex from Member Order by Memid"
lbl_status.Caption = " Search for Member's Record field Alldata."
mpbar.Value = 40
ElseIf (cmb_mfield.Text = "First name") Then
fnd = "select Address,Birthdate,Bookinhand,Deposite,Doexpire,Dojoin,Email,Fname,Lname,Memid,Noted,Phone,Sex from Member where Fname like '" & Trim(txt_mvalue.Text) & "%'"
mpbar.Value = 40
ElseIf (cmb_mfield.Text = "Last name") Then
fnd = "select Address,Birthdate,Bookinhand,Deposite,Doexpire,Dojoin,Email,Fname,Lname,Memid,Noted,Phone,Sex from Member where Lname like '" & Trim(txt_mvalue.Text) & "%'"
mpbar.Value = 40
ElseIf (cmb_mfield.Text = "Member id") Then
fnd = "select Address,Birthdate,Bookinhand,Deposite,Doexpire,Dojoin,Email,Fname,Lname,Memid,Noted,Phone,Sex from Member where Memid=" & Trim(txt_mvalue.Text)
mpbar.Value = 40
ElseIf (cmb_mfield.Text = "Address") Then
fnd = "select Address,Birthdate,Bookinhand,Deposite,Doexpire,Dojoin,Email,Fname,Lname,Memid,Noted,Phone,Sex from Member where Address like '" & Trim(txt_mvalue.Text) & "%'"
mpbar.Value = 40
ElseIf (cmb_mfield.Text = "Phone") Then
fnd = "select Address,Birthdate,Bookinhand,Deposite,Doexpire,Dojoin,Email,Fname,Lname,Memid,Noted,Phone,Sex from Member where Phone like'" & Trim(txt_mvalue.Text) & "%'"
mpbar.Value = 40
ElseIf (cmb_mfield.Text = "Email") Then
fnd = "select Address,Birthdate,Bookinhand,Deposite,Doexpire,Dojoin,Email,Fname,Lname,Memid,Noted,Phone,Sex from Member where Email like'" & Trim(txt_mvalue.Text) & "%'"
mpbar.Value = 40
ElseIf (cmb_mfield.Text = "Birth date") Then
fnd = "select Address,Birthdate,Bookinhand,Deposite,Doexpire,Dojoin,Email,Fname,Lname,Memid,Noted,Phone,Sex from Member where Birthdate like'" & Trim(txt_mvalue.Text) & "%'"
mpbar.Value = 40
ElseIf (cmb_mfield.Text = "Date of join") Then
fnd = "select Address,Birthdate,Bookinhand,Deposite,Doexpire,Dojoin,Email,Fname,Lname,Memid,Noted,Phone,Sex from Member where Dojoin like'" & Trim(txt_mvalue.Text) & "%'"
Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, ByRef phkResult As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, ByRef lpType As Long, ByVal lpData As String, ByRef lpcbData As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
Private Sub cmdSysInfo_Click()
Call StartSysInfo
End Sub
Private Sub cmdOK_Click()
Unload Me
End Sub
Public Sub StartSysInfo()
On Error GoTo SysInfoErr
Dim rc As Long
Dim SysInfoPath As String
' Try To Get System Info Program Path\Name From Registry...
If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then
' Try To Get System Info Program Path Only From Registry...
ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then
' Validate Existance Of Known 32 Bit File Version
If (Dir(SysInfoPath & "\MSINFO32.EXE") <> "") Then
SysInfoPath = SysInfoPath & "\MSINFO32.EXE"
' Error - File Can Not Be Found...
Else
GoTo SysInfoErr
End If
' Error - Registry Entry Can Not Be Found...
Else
GoTo SysInfoErr
End If
Call Shell(SysInfoPath, vbNormalFocus)
Exit Sub
SysInfoErr:
MsgBox "System Information Is Unavailable At This Time", vbOKOnly
End Sub
Public Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, ByRef KeyVal As String) As Boolean
Dim i As Long ' Loop Counter
Dim rc As Long ' Return Code
Dim hKey As Long ' Handle To An Open Registry Key
Dim hDepth As Long '
Dim KeyValType As Long ' Data Type Of A Registry Key
Dim tmpVal As String ' Tempory Storage For A Registry Key Value
Dim KeyValSize As Long ' Size Of Registry Key Variable
modulers.Open "select Dayslimit,Fratepday,Maxhold,Pass,Refcopy,Salnew,Salper,Saltemp,Splashtime,Viewe,Welcometime,Welcome from Custom", moduleconn, adOpenStatic, adLockOptimistic
view = modulers.Fields(9)
fratepday = modulers.Fields(1)
dayslimit = modulers.Fields(0)
refcopy = modulers.Fields(4)
maxhold = modulers.Fields(2)
salnew = modulers.Fields(5)
saltemp = modulers.Fields(7)
salper = modulers.Fields(6)
splashtime = modulers.Fields(8)
welcometime = modulers.Fields(10)
Welcome = modulers.Fields(11)
modulers.Close
Load frmLogin
Load mdi_start
DoEvents
mdi_start.Show
frmLogin.Show vbModal
End Sub
Books Form Individual Views:-
This form contains information about books. New book can be added here. Any book which is now not in this library can be deleted using this form. This form also has a detail view tab. If the user clicks this tab a list of all books available is shown. Constraints on some fields are provided so as to ensure data integrity.
Books Form Detail Views:-
Members Form Individual Views:-
This form contains information about members. New members can be addes here.Any person who wants to widraw the services provided can be deleted from records here.It contains fields like personal information, amount deposited, library information etc.Detaild view of this form shows the list of all members of the library.This form also has detail view tab.if the users clicks this tab a list of all the members is shown.Constraints on some fields are provided so as to ensure data integrity.
Members Form Details Views:-
IssueForm:-
Return Form:-
Fine Information Form:-
This all form help the user to enter information about the books issued, books returned &fine on any member.Issue foem &return form data can be added but fine information form showe the list of the members along with the fine.
Search Form:-
This form is used to search any information regarding any book or member according to given criteria.
Global Form:-
This form contains global information about books in the library.
Keybord Form:-
About Form:-
MDI Form:-
Reports:-
Data Report of Library Book List:
Data Report of Member List:
Data Report of Library Issue/Return Book List:
Splash Form:-
CONCLUSION
Computerization of the Library system will help the institution “GGNIVS” to maintain the database of Library easily. Because the Library system is fully computerized so there is no conflict. This will help the user to check net salary of any employee and their details anytime. There is full security of database. No unauthorized person can access the database.
So, the overall performance will be helpful to the institute.