Documente Academic
Documente Profesional
Documente Cultură
IN
VISUAL BASIC 6.0
&
MS ACCESS
Project Report Submitted in partial fulfillment of the requirement
For the award of
Supervised By:
Mr. Harish
Submitted by:
Abhishek Rai
Enrollment No -1202814
CERTIFICATE OF ORIGINALITY
This is certify that the project report entitled Library Management submitted
to PUNJAB TECHNICAL UNIVERSITY in Jalandhar fulfillment of the
requirement of the award of the degree of
BACHELOR OF
COMPUTER
Supervised By:
Submitted By:
Mr. Harish
Abhishek Rai
Enrollment No - 1202814
ACKNOWLEDGEMENT
Success is to be measured not so much by the position that one has reached in
life, but as by the obstacles which he has to overcome while trying to succeed.
One must always be grateful for the help an assistance given in this selforiented individualistic world, which is very difficult for each and every one.
I wish to express my sincere thanks to Mr. Harish and all the faculty
members of SATYAM INSTITUTE OF ENGINEERING Technologies Amritsar
whose guideline in the course of BCA had, bring me in the field of computer, to a so
strong position that I can do a project myself.
I also want to give thanks to my friends and classmates for their help, in
discussing a problematic situation in detail, which helps me in coping with that
As a debt of more personal sort, I owe to my parents for inspiration and moral
support throughout this project. They provide me both material and money support,
which is potent for any project development.
Once again I want to give my sincere thanks to all of them who have
given me any kind of help during my project development.
Contents
Software Requirement
Hardware Requirement
Integrated Development Environment
Event Driven Programming
Database Models
System Analysis
Objective Of The Proposed System
System Study
Problem Study
Database Tables To Be Used
Program
Back End
MS Access
Operating System
Windows 9x.
Front End : Visual Basic is the most powerful rapid application development tool.
Visual Basic helps programmer to focus on the programmer to focus on the problems
at hand rather than the technical intricacies of programming in a windows
environment.
A lot many commercial applications available today are written using visual
basic. It provides a complete set of built-in intelligent tools for creating windows
application programs.
Back End: MS Access is a Relational Database Management System (RDBMS)
used to store and manipulate large collection of information of any kind. Here
RDBMS refers to the organization of data in a series of rows and columns in such a
manner that any specific piece of Information is available with the click of a mouse
and a few key strokes. MS-Access has tools which are easy to use and provide
powerful development environment, making it an appropriate choice for novices as
well as professionals. Once the records are stored, any types of queries
can be asked, reports can be created and data entry forms can be designed. At an
advanced level, Access can be used for developing custom database applications by
employing Access Basic and a Distribution kit for compiling applications.
2.3
HARDWARE REQUIREMENTS
System Configurations
Minimum Hardware Requirements:
Microprocessor
RAM
Bus Speed
Floppy Drive
Monitor
Printer
2.4
Inkjet/Laser/Dot Matrix
OBJECTIVE
3.
have a code editor window for each window for each form in the application. Any
code you need to attach to the form or any control on the form you need to type it in
the Code Editor Window. A code window has drop-down list boxes at the top. The list
box on the left side displays a list of objects placed on the form. The list box on the
right side displays all the events associated with the object selected in the left side box
User Interface
User interface specifies what the user will actually see and interact with, when the user will
use the application. Before you can being to write any code, you must design what is called the user
interface. The user interface is the way the user communicates with your computer.
Visual Basic Forms
A form is a display area that corresponds to a window or dialog box that makes up the part
of an application's user interface Forms is the name given for the window in the Visual Basic. In
addition to the form, each form has properties associated with it. In Visual Basic there are two types
of forms, namely the Normal Form and a Multi-Document Interface (MDI) form. The normal form
can either exist independently or can be a child form of the MDI form. A forms collection is a
collection of all the loaded forms in an application. All the forms you add to an application are
automatically added to a form collection.
The .EXE file can be made by the combination of Forms(.FRM) Modules (.BAS), and
Control (.OCX) which can be shown as in the next page:
In the same way, when you write the visual basic programs, you must tell what will happen
when the user clicks your button, or types some text into the text box. This kind of programming
where the code is executed in reaction to user action is termed as an Event Driven Programming.
An event is when the user performs an action on the computer like clicking a button or
selecting the menu item. There are a numerous number of events.
An event handler is a set of instructions that is triggered in response to an event.
WWSIWYG : What you see is what you get. In Visual Basic platform your windows
program appears before your eyes as you add the objects.
VB can create Graphics to add pizzazz to the screens that you design.
Using common dialog boxes, user can access typical features expect in windows
application.
DATABASE MODELS
*
Hierachical
Network
Relational
Hierarchical Model
This model was introduced in the Information Management System (IMS) developed by IBM in
1968. This model is like a hierarchical tree structure, used to construct a hierarchy record in the
form of nodes and branches. The data elements present in the structure have a Parent-Child
relationship. Closely related information in the Parent-Child structure is stored together as a
logical unit. A parent unit may have many child units, but a child is restricted to have only one
parent.
1.
The hierarchical structure is not flexible enough to represent all the relationship
proportions, which occur in the real world.
2.
It cannot demonstrate the overall data model for enterprise because of the non-availability
of actual data at the time of designing the data model.
3.
4.
The Hierarchical Model is used when the concerned data has a clearly hierarchical
character with a single root, for example the Dos Directory Structure.
Network Model
Relational Model
*
All values appearing in the columns are derived from the underlying domain.
E.F. Code in June 1970 in the "Communication of ACM", set a trend for vigorous and extensive
investigation into a theoretical framework to support further work in the area of Data Modeling.
The end result is the Relational Database Management Systems (RDBMS).
In RDBMS, the data is organized in tables consisting of rows and columns.
Information Representation
Guaranteed Access
View Updating
Non-Subversion
Integrity Rule
Normalization
Normalization is the process of refining the data model built by the Entity-Relationship
Diagram. The Normalization technique logically groups the data over a number of tables, which are
independent and contain no duplicate data.
The entities or tables resulting from Normalization contain simple data items, with
relationships being represented by replication of key data item(s).
The goal of a relationship database design is to generate a set of relation schemes that allow
us to store information without redundant data and allow us to retrieve information easily and
efficiently. The approach followed is to design schemes that are in an appropriate one of the socalled Normal Form.
Steps in Normalization
Key of parent table is brought as part of the concatenated key of the second table.
Group interdependent fields as separate tables, identify the key and name the table.
5.
SYSTEM ANALYSIS
Feasibility Study
The objective of Initial Investigation is to determine whether the request is valid and feasible
before a recommendation is reached to do nothing, improve, or modify the existing system, or build
a new one.
Depending on the results of the initial investigation, the survey is expanded to a more
detailed feasibility study. A feasibility study is a test of a system proposal according to its
workability, impact on the organization, ability to meet user needs, and effective use of resources. It
focuses on three major
1. What are the user's demonstrable needs and how does a candidate system meet them?
2. What resources are available for given candidate systems?
3. What is the likely impact of the candidate system on the organization?
1. Economic Feasibility
2. Technical Feasibility
3. Behavioral Feasibility.
ECONOMIC FEASIBILITY:
Economic Analysis is the most frequently used method for evaluating the effectiveness of a
candidate system. A procedure of cost/ benefit analysis is applied to determine the savings and
benefits outweigh the costs, then the decision is made to design and implement the system.
Otherwise, further justification or alterations in the propose system will have to be made if it is to
have a chance of being approved. This is an ongoing effort that improves in accuracy at each phase
of the system life cycle.
SOCIAL FEASIBILITY:
It is important to study the social implications when a new product or system is introduced. People
are inherently resistant to change and computers have been known to facilitate change. An estimate
should be made of how strong a reaction user staff is likely to have towards the development of a
computerized system. It is common that computer installation results in turnover, transfers,
retraining and changes in the employee's job status. Therefore, it is undesirable that the introduction
of the candidate system requires special effect to educate, sell, and train the staff on new ways of
conducting business. When we explained our system to users, they gave a good response.
BEHAVIORAL FEASIBILITY:
People are inherently resistant to change and computers have be known to facilitate change it
is common knowledge that the computer installation has something to with turnover, transfer,
retraining and changes in the employee job status therefore it is understandable that the introduction
of the candidate system requires special effort to educate and train the staff on new ways of
conducting business.
Points that the user staff raised against the new system.
1.
2.
3.
Change in job status and may be demotion, if found not qualified for the job.
4.
5.
6.
7.
Difficult and time consuming requires if system failure occurs during the working hours.
8.
Loss of time and working hours if the system is not repaired on the time.
The user staff that had to directly work on the new system gave all the limitation or the
apprehensions that are listed above they feared that the new system would result in the demotions or
they will be out of their jobs. They may not be computer literate they said that in order to retain their
jobs they would have to understand computer training at the private institute which is very expensive
and difficult at their personal cost.
All the fears that were expressed by the user staff are only humor because every human has
been known to resist change unless or otherwise he has the necessary qualifications. The users staff
fears are genuine but they can be met in an efficient manner.
TECHNICAL FEASIBILITY:
It involves determining whether or not a system can actually be constructed to solve the
problem at hand. Technical feasibility centers on the existing computer system (hardware, software)
etc. and to what extent it can support the proposed system. System developed by us is technically
feasible because no system was previously running on their system as he has purchased a new
system. Our system would be easy to use as it is user friendly to a person who knows simple English
can easily use it effectively and it is capable of fulfilling their requirements about the production,
sales, purchase, stock control of products and employee information.
The various issues considered for the technical feasibility are :
*
As the user know that the existing system that is in the use at the users work place at the
manual. All the operations that are being done on the data are manual. This system is working well
but it resulting in huge loss. All the time loss and money lost can be put to various other uses, if all
the time lost can be recovered. The new system can be designed in such a way that it retains the
basic structure of the user's manual system that is in use at the moment, because then it would not be
the difficult for the user and user staff to acquaint them with the new system. The new system would
be made on software that is easy to understand for the user staff and they can be given the adequate
training for operating it the new system would be based on such software that it is easy to maintain
and repair. The equipment's used in the system have the capacity to hold the data required.
The major and basic advantage of the new system that it would be greatly reduce the load
on the employees of College. They; would be able to do same amount of work in less amount of
time. The new system should be design in such a way that is able to hold a large amount of data. The
transfer of the data from one place to other place would be quite easy. The new system should be
very interactive in nature as compared to the existing one.
Procedure manuals and forms are useful sources for the analyst. They describe the
format and functions of the present system. Included in most manuals are system requirement
that help determine how well various objectives are met. Up to date manuals save hours of
information gathering time. Unfortunately, in may cases, manuals do not exist or are
seriously out of date.
6.1
The most critical phase of the system development is System Analysis. Analysis is a
detailed study of the various operations performed by the system. One aspect of
analysis is defining the boundaries of the system and determining whether or not a
candidate system should consider other related system. To launch a system
Investigation we need master plan to achieve our target. The major steps of analysis is
designing to see the user requirements by studying the present system, to verify the
problem and to the requirement wanted to designed the candidate system to meet user
requirements.
The goal of system analysis is to see whether existing system can be improved
or not. If it can be improved cost to implement that system is justified what
improvements are done in the system. Here in this case there is the doubt that
presently existing manual systems can be improved tremendously by changing certain
few procedures and giving training to the employees. But from the study of present
manual system it's found that there is a large amount of redundancy i.e. some of
information has to be recorded and checked repeatedly which lead to enormous
wastage of time and increase the possibility of committing errors.
Considering all these aspects, the introduction of computer is done to
2.
Early versions of the design, though incomplete, are useful enough resemble
the real system.
3.
4.
The top level shows the most important division of work, the lowest level at the
bottom shows the details.
The documentation tool for design is the hierarchy or structure chart. It is a
graphic tool for representing hierarchy, and it has three elements.
a.
contiguous
set of elements.
b.
c. The COUPLE is represented by an arrow with a circular tail. It represents data items
moved from one module to another.
There is a lot of wastage of man power in the existing manual system due to
the time consumption in the checking of various entries and the time consumed in
typing various reports.
*
It adds to volume of paper and file work, which becomes inconvenient and
untidy.
*
The existing manual system is a very expensive method, as lot of paper work
has to be done and lot of wastage of manpower, which increase the expenses of the
existing system.
*
*
There are more chances of mistakes in the existing system as entries have to
be made many times.
*
Integrity of data is not supported by the existing manual system. Data in files
has to be transferred from one department to another manually.
*
Redundancy is not avoided in the present system, which leads to
inconvenience.
*
The different users in the different departments cannot share data
simultaneously.
*
Security features are not prominent in the existing system.
.
5. Even stranger to computer can use the system being menu driven,
with little efforts.
PROPOSED SYSTEM:
Certainly, there is no doubt that existing manual system can be improved
tremendously by changing few or some processes and employing trained manpower. The proposed
system is aimed to computerize and replace the manual system so as to bring correctness , efficiency,
security and integrity. Through this method detailed and comprehensive reports can be prepared . As
already explained that the existing system have workload unnecessary botheration about the records
of sample data conceiving the problem of existing system along with its limitation.
The only viable solution left is to computerization of textile firm. The prime reason
being that the computer is capable of processing large amount of data enormously that human take
error in every 500 to 1000 operations with the calculator the circuits of computer on the other hand
can perform millions of operations every seconds and run errorless for hours and days at a time. This
is because they require no human intervention between processing operations and have no
mechanical parts to wear and malfunction. The proposed system will fulfill its input requirements
from:
Existing System:
With this information, the proposed system will be capable of generating important and
indispensable reports namely Pending data and Despatched data etc.
Now they can keep information about the Sample Data, Child Sample Data. The
major advantages of proposed system are:
1.
2.
3.
Reports and bills can be made available which is must for them.
4.
5.
Even stranger to computer can use the system being menu driven, with little efforts.
To minimize the time taken for the preparation of various stock reports and the cost reports
To minimize the expenses of the existing manual system by efficiently using the manpower
To take accurate and quick information for decision making of the management of the
college administration.
Integrity of data is maintained by the proposed system. In this way inconsistencies between
Security of data is maintained over the operational data. Various authorization checks can be
applied whenever access to sensitive data is attempted. Different checks can be established for each
type of access (retrieve, modify, delete etc.) to each piece of information in the database.
*
Proposed system also supports the sharing of data. Data can be shared among different users.
Concurrent sharing is also possible i.e. various users can share the same piece of data at the same
time.
*
Access to data between different users can be divided. Different views can be constructed in
order to allow a particular student an employees with the data that we want to show.
Considering all these aspects, the introduction, of computers to overcome the above mentioned
difficulties provide a complete justification to computerize the existing system of firm.
SYSTEM STUDY
A system study is an orderly grouping of interrelated, interdependent components linked
together according to a predefined plan to achieve a specific objective. For example telephone
system, business system, transportation system etc. Any predefined or programmed techniques or
steps that help to complete a certain job in efficient manner, can be called a system. When the new
system is developed we need to study the old system and their relationship within and outside of the
system. A key question is what must be done to solve the problem. During the system study data are
collected on files decision points and transaction handled by the present system in this system we
need to analysis how manual system for payroll system work.
* Organisation:
Organisation implies the structure and order. It is the arrangement of the
components that help to achieve the objectives. for example in a business the hierarchical
relationships.
* Intersection: Intersection refer to the manner in which each component function with other
components of the system. E.g. Payroll with personnel.
* Interdependence : It means that a part of the system depends upon another part. Output of one
sub system is required input of another system and vice-versa E.g.
User
Area
System Analysis
Programming
Operations
Integration: Integration refers to the holism of the system successful integration will typically
produce the synergistic effect and greater the total impact than if component works independently.
THE DATA FLOW DIAGRAM (DFD)
The DFD was first developed by Larry Constantine, as a way of expressing system
requirements in a graphical form, this led to a modular design.
A DFD is also known as a "bubble chart". A DFD has the purpose of clarifying system
requirements and identifying major transformations that will become programs in system design. So
it is the starting point of the design phase that functionally decomposes the requirements
specifications down to the lowest level of detail. A DFD consists of a series of bubbles joined lines.
The bubbles represent data transformations and the lines represent data flows in the system.
DFD Symbols
In the DFD, there are four symbols.
1.
2.
An arrow identifies data flow - data in motion. It pipeline through which information flows.
3.
A circle or a "bubble" (or an oval bubble) represents a process that transforms incoming data
flow(s) into outgoing data flow(s).
5.
A DFD describes what data flows i.e. logical data flow rather than how they are processed,
and so it does not depend on hardware, software, data structures, or file organization.
Constructing a DFD
Several rules of thumb are used in drawing DFDs.
1.
Processes should be named and numbered for easy reference. Each name should be
representative of the process.
2.
The direction of flow is from top to bottom and from left to right. Data traditionally flow
from source (upper left comer) to the destination (lower right comer) although they may flow back to
a source. One way to indicate this is to draw along flow back to a source. An alternative way is to
repeat the source symbol as a destination. Since it is used more than once in a DFD, it is marked
with a short diagonal in the lower right corner.
3.
4.
5. SYSTEM DESIGN
System design is most creative phase of the system development. The term design describes a
final system and the process it is developed. It includes the construction of programs and program
testing. The key question of system design is, how should problem be solved.
A systematic method has to achieve the beneficial results at the end. It involves starting with
a vague idea and developing it into a series of steps. The series of steps for successful system
development or successful system design are given below :
1.
The first step is to study problem completely because first of all we should know the goal,
which we have to achieve.
2
The second step we should see what kind of output we require and what kind of input we
give so that we can get desired output from system. It is very challenging step of the system
development.
3.
According to input requirement of the system the structure of various databases should be
design.
4.
Next we should know what kind of program should be developed which will reach us to
reach final goal.
5.
Then we write this individual program, which later on joining solve problem.
6.
Then we test these programs and make necessary correction in them to achieve target of the
programs.
7.
At last combining all these problems in the form of a bar in the menu of the window, which
all complete software package for stock and billing system of Firm.
In other words, various steps involved in system design are:
1.
Problem Definition
2.
Input/Output Specification.
3.
Database Design
4.
5.
6.
7.
PROBLEM DEFINATION
A software development is like a puzzle, which is to be solved to create a new system. When
we start we should know clearly and exactly about the problem, where it exists and we should know
every aspect of our problem before we start to solve the problem. The problem seems vague at
starting because we are unaware that how the work is done actually what kind of difficulty are met
and how they are tackled every detail has to be studied because a little mistake in studying detail
leads to drastic change in the results. Here my project is to maintain. The main aim of the software is
to keep data of Labels that are pending and dispatched.
INPUT/OUTPUT SPECIFICATIONS
On this step we should see what kind of output we required and then plan what kind of input
we give so that we can get the desired output from the system. In this design, user oriented inputs are
converted into computer based format.
In output design the emphasis is on producing a hard copy of in formation required or
displaying the output on monitor in a predefined format.
*
Monthly cash receipts reports are generated to give information about the material that are
pending or dispatched.
*
Also lot of paper work and manual work is prevented. Because we can get every information
Case is to be taken so as to design the reports with necessary information and on the same
time avoiding the unnecessary information because a irrelevant information are worse than no
information.
CODING :
Once the design is complete, most of the major decision about the system has been
made. Now next phase of the system development is the coding. The goal of the coding phase is to
translate the design of the system into code in a given programming language. In this phase we
aimed to implement the design in the best possible manner which is already prepared. Many of the
detail about the coding depends on the programming language chosen, are not specified during the
design. In our case we use VISUAL BASIC 6.0 as the programming language. The Coding phase
affect both testing and maintenance profoundly. The well-written code reduces the testing and the
maintenance phase. So during the coding phase our focus was on developing the programs that are
easy to read and understandable and also simple to write.
An important concept considered in the coding is the structured programming that helps in
understanding the programs in the better way. The goal of the structured programming is to linearize
the control flow in the program. The text in the program is organized as a sequence of statement and
the statements are executed in a sequence given in the program.
The coding in the Visual Basic helps us in many ways. Like whenever an error occurs it gives
the necessary message immediately. Error message prompt us when ever wrong action is taken.
The characteristics of my coding are :
*
Jumps are tried to avoid as much as possible. Modules are made fairly general.
STUDENT ISSUE
Imports System.Data.OleDb
Public Class Form1
Inherits System.Windows.Forms.Form
Dim dr As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
On Error Resume Next
Me.Size = New Size(800, 600)
Me.Location = New Point(80, 25)
bol = "lib"
DateTimePicker1.Value = Today
ListView1.Items.Clear()
ListView1.Columns(0).Text = "Library Card No"
ListView1.Columns(1).Text = "Student Name"
ListView1.Columns(2).Text = "Roll No"
ListView1.Columns(3).Text = "Class"
s = "select cardno,sname,rollno,class from student"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
'MsgBox(ds.Tables(0).Rows.Count)
If ds.Tables(0).Rows.Count > 0 Then
For i = 0 To ds.Tables(0).Rows.Count - 1
ListView1.Items.Add(ds.Tables(0).Rows(i)(0))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3))
Next
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
On Error Resume Next
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Then
MsgBox("Incomplete Informaton", MsgBoxStyle.Information)
TextBox1.Focus()
Exit Sub
End If
s = "select * from student where cardno='" & Trim(TextBox1.Text) & "'and sname='" &
Trim(TextBox3.Text) & "'and class='" & Trim(TextBox4.Text) & "'and rollno='" &
Trim(TextBox5.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count <= 0 Then
MsgBox("Student record not matched", MsgBoxStyle.Exclamation)
TextBox3.Focus()
Exit Sub
End If
s = "select bookid,bname from book where bookid='" & Trim(TextBox2.Text) & "'and
bname='" & Trim(TextBox8.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count <= 0 Then
MsgBox("Book record not found", MsgBoxStyle.Information)
TextBox8.Focus()
Exit Sub
End If
s = "select cardno from studentissue where cardno='" & Trim(TextBox1.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
MsgBox("Cannot Issue" & ControlChars.CrLf & "Book already issue to student",
MsgBoxStyle.Information)
TextBox1.Focus()
Exit Sub
End If
s = "select bookid from studentissue where bookid='" & Trim(TextBox2.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
MsgBox("Cannot Issue" & ControlChars.CrLf & "Select Book already issue to another
student", MsgBoxStyle.Information)
TextBox2.Focus()
Exit Sub
End If
dr = Format(DateAdd(DateInterval.Day, 14, DateTimePicker1.Value),
"dd/MMMM/yyyy")
s = "insert into studentissue values('" & Trim(TextBox1.Text) & "','" &
Trim(TextBox2.Text) & "','" & Trim(TextBox3.Text) & "','" & Trim(TextBox4.Text) & "','" &
Trim(TextBox5.Text) & "','" & Trim(TextBox8.Text) & "','" & DateTimePicker1.Value & "','" &
dr & "')"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
MsgBox("Book Issued" & ControlChars.CrLf & "Date of Issue:" &
Format(DateTimePicker1.Value, "dd/MMM/yyyy") & ControlChars.CrLf & "Date of
Return:" & dr, MsgBoxStyle.Information)
Button3.PerformClick()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
On Error Resume Next
If Not TextBox1.Text = "" Then
s = "select * from student where cardno='" & Trim(TextBox1.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count <= 0 Then
MsgBox("Invalid Library card number", MsgBoxStyle.Information)
TextBox1.Focus()
Exit Sub
Else
TextBox5.Text = ds.Tables(0).Rows(0)(0)
TextBox3.Text = ds.Tables(0).Rows(0)(2)
TextBox4.Text = ds.Tables(0).Rows(0)(3)
End If
End If
If Not TextBox2.Text = "" Then
s = "select bname from book where bookid='" & Trim(TextBox2.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count <= 0 Then
ByVal
As
ByVal
As
Imports System.Data.OleDb
Public Class Form2
Inherits System.Windows.Forms.Form
Dim f1 As Integer
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
On Error Resume Next
TextBox12.Text = 0
ListView1.Columns(0).Text = "Library Card No"
ListView1.Columns(1).Text = "Student Name"
ListView1.Columns(2).Text = "Book ID"
ListView1.Columns(3).Text = "Book Name"
ListView1.Columns(4).Text = "Issue Date"
ListView1.Columns(5).Text = "Class"
ListView1.Columns(6).Text = "Roll No."
s = "select * from studentissue"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
For i = 0 To ds.Tables(0).Rows.Count - 1
ListView1.Items.Add(ds.Tables(0).Rows(i)(0))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(5))
ListView1.Items(i).SubItems.Add(DateValue(ds.Tables(0).Rows(i)(6)))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(4))
Next
End If
End Sub
Private Sub TextBox1_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TextBox1.DoubleClick
On Error Resume Next
bol = "lib"
ListView1.Items.Clear()
ListView1.Columns(0).Text = "Library Card No"
As
Next
End If
End If
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox1.TextChanged
End Sub
'Private Sub Form2_Activated(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MyBase.Activated
' If bol = "issue" Then
'
TextBox1.Text = col
'
TextBox3.Text = col1
'
TextBox2.Text = col2
'
TextBox9.Text = col3
'
TextBox4.Text = col4
'
TextBox5.Text = col5
'
TextBox10.Text = col6
'
DateTimePicker1.Value = col7
' End If
' bol = ""
'End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
On Error Resume Next
If Not TextBox1.Text = "" Then
s = "select * from studentissue where cardno='" & Trim(TextBox1.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count <= 0 Then
MsgBox("Library card number not found", MsgBoxStyle.Information)
TextBox1.Focus()
Exit Sub
Else
TextBox3.Text = ds.Tables(0).Rows(0)(2)
TextBox4.Text = ds.Tables(0).Rows(0)(3)
TextBox5.Text = ds.Tables(0).Rows(0)(4)
End If
End If
If Not TextBox2.Text = "" Then
s = "select * from studentissue where bookid='" & Trim(TextBox2.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count <= 0 Then
MsgBox("Book ID not found", MsgBoxStyle.Information)
TextBox2.Focus()
Exit Sub
Else
TextBox9.Text = ds.Tables(0).Rows(0)(5)
TextBox10.Text = ds.Tables(0).Rows(0)(6)
DateTimePicker1.Value = ds.Tables(0).Rows(0)(7)
End If
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
On Error Resume Next
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = ""
Then
MsgBox("Incomple information", MsgBoxStyle.Exclamation)
TextBox1.Focus()
Exit Sub
End If
's = "select * from studentissue where cardno='" & Trim(TextBox1.Text) & "' and
bookid='" & Trim(TextBox2.Text) & "' and sname='" & Trim(TextBox3.Text) & "' and class='"
& Trim(TextBox4.Text) & "' and rollno='" & Trim(TextBox5.Text) & "' and bname='" &
Trim(TextBox9.Text) & "' and issuedate='" & DateValue(Trim(TextBox10.Text)) & "'"
s = "select * from studentissue where cardno='" & Trim(TextBox1.Text) & "'and
bookid='" & Trim(TextBox2.Text) & "' and sname='" & Trim(TextBox3.Text) & "' and class='"
& Trim(TextBox4.Text) & "' and rollno='" & Trim(TextBox5.Text) & "' and bname='" &
Trim(TextBox9.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count <= 0 Then
MsgBox("Record not found", MsgBoxStyle.Information)
TextBox1.Focus()
Exit Sub
End If
f1 = DateDiff(DateInterval.Day, DateValue(ds.Tables(0).Rows(0)(7)),
DateValue(DateTimePicker1.Value))
If f1 > 0 Then
f1 = f1 * 2
Else
f1 = 0
End If
TextBox12.Text = f1
s = "delete from studentissue where bookid='" & Trim(TextBox2.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
MsgBox("Book return" & ControlChars.CrLf & "Fine::" & f1, MsgBoxStyle.Information)
ListView1.Items.Clear()
s = "select * from studentissue"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
For i = 0 To ds.Tables(0).Rows.Count - 1
ListView1.Items.Add(ds.Tables(0).Rows(i)(0))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(5))
ListView1.Items(i).SubItems.Add(DateValue(ds.Tables(0).Rows(i)(6)))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(4))
Next
End If
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
Me.Close()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
'TextBox8.Clear()
TextBox9.Clear()
TextBox10.Clear()
End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ListView1.SelectedIndexChanged
On Error Resume Next
TextBox1.Text = ListView1.SelectedItems(0).Text
TextBox3.Text = ListView1.SelectedItems(0).SubItems(1).Text
TextBox2.Text = ListView1.SelectedItems(0).SubItems(2).Text
TextBox9.Text = ListView1.SelectedItems(0).SubItems(3).Text
TextBox10.Text = ListView1.SelectedItems(0).SubItems(4).Text
TextBox4.Text = ListView1.SelectedItems(0).SubItems(5).Text
TextBox5.Text = ListView1.SelectedItems(0).SubItems(6).Text
f1 = DateDiff(DateInterval.Day, DateValue(ds.Tables(0).Rows(0)(7)),
DateValue(DateTimePicker1.Value))
If f1 > 0 Then
f1 = f1 * 2
Else
f1 = 0
End If
TextBox12.Text = f1
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles TextBox2.TextChanged
End Sub
End Class
TEACHER ISSUE
Imports System.Data.OleDb
Public Class Form3
Inherits System.Windows.Forms.Form
TextBox1.Focus()
Exit Sub
End If
s = "select * from teacher where teacher_id='" & Trim(TextBox2.Text) & "'and
firstname='" & Trim(TextBox4.Text) & "'and department='" & Trim(TextBox5.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count <= 0 Then
MsgBox("Teacher record not matched", MsgBoxStyle.Exclamation)
TextBox1.Focus()
Exit Sub
End If
s = "select bookid,bname from book where bookid='" & Trim(TextBox1.Text) & "'and
bname='" & Trim(TextBox7.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count <= 0 Then
MsgBox("Book record not found", MsgBoxStyle.Information)
TextBox2.Focus()
Exit Sub
End If
s = "select bookid from studentissue where bookid='" & Trim(TextBox1.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
MsgBox("Cannot Issue" & ControlChars.CrLf & "Select Book already issue to another
student", MsgBoxStyle.Information)
TextBox2.Focus()
Exit Sub
End If
s = "select book_id from teacherissue where book_id='" & Trim(TextBox1.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
MsgBox("Cannot Issue" & ControlChars.CrLf & "Select Book already issue to another
teacher", MsgBoxStyle.Information)
TextBox2.Focus()
Exit Sub
End If
dr = Format(DateAdd(DateInterval.Day, 14, DateTimePicker1.Value),
"dd/MMMM/yyyy")
s = "insert into teacherissue values('" & Trim(TextBox1.Text) & "','" &
Trim(TextBox2.Text) & "','" & Trim(TextBox4.Text) & "','" & Trim(TextBox5.Text) & "','" &
DateTimePicker1.Value & "','" & Trim(TextBox7.Text) & "')"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
MsgBox("Book Issued" & ControlChars.CrLf & "Date of Issue:" &
Format(DateTimePicker1.Value, "dd/MMM/yyyy") & ControlChars.CrLf & "Date of
Return:" & dr, MsgBoxStyle.Information)
End Sub
Private Sub TextBox1_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TextBox1.DoubleClick
On Error Resume Next
Label5.Text = "Book Record"
bol = "book"
ListView1.Items.Clear()
ListView1.Columns(0).Text = "Book ID"
ListView1.Columns(1).Text = "Book Name"
ListView1.Columns(2).Text = "Author Name"
ListView1.Columns(3).Text = "Publisher"
s = "select bookid,bname,aname,publisher from book"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
For i = 0 To ds.Tables(0).Rows.Count - 1
ListView1.Items.Add(ds.Tables(0).Rows(i)(0))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3))
Next
End If
End Sub
Private Sub TextBox1_KeyPress(ByVal sender As Object,
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
ByVal
As
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2))
Next
End If
End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ListView1.SelectedIndexChanged
On Error Resume Next
If bol = "tea" Then
TextBox2.Text = ListView1.SelectedItems(0).Text
TextBox5.Text = ListView1.SelectedItems(0).SubItems(1).Text
TextBox4.Text = ListView1.SelectedItems(0).SubItems(2).Text
Else
TextBox1.Text = ListView1.SelectedItems(0).Text
TextBox7.Text = ListView1.SelectedItems(0).SubItems(1).Text
End If
End Sub
End Class
TEACHER RETURN
Imports System.Data.OleDb
Public Class Form4
Inherits System.Windows.Forms.Form
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button4.Click
Me.Close()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
End Sub
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
ComboBox1.Focus()
Exit Sub
End If
s = "select * from teacherissue where book_id='" & Trim(ComboBox1.Text) & "'and
teacher_id='" & Trim(ComboBox2.Text) & "' and teacher_name='" & Trim(TextBox4.Text) &
"' and book_name='" & Trim(TextBox7.Text) & "' and department='" & Trim(TextBox5.Text)
& "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count <= 0 Then
MsgBox("Record not found", MsgBoxStyle.Information)
ComboBox1.Focus()
Exit Sub
End If
s = "delete from teacherissue where book_id='" & Trim(ComboBox1.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
MsgBox("Book return", MsgBoxStyle.Information)
ListView1.Items.Clear()
s = "select * from teacherissue"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
For i = 0 To ds.Tables(0).Rows.Count - 1
ListView1.Items.Add(ds.Tables(0).Rows(i)(0))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(1))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(2))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(3))
ListView1.Items(i).SubItems.Add(DateValue(ds.Tables(0).Rows(i)(4)))
ListView1.Items(i).SubItems.Add(ds.Tables(0).Rows(i)(5))
Next
End If
End Sub
End Class
ADD NEW BOOK
Imports System.Data.OleDb
Public Class Form5
Inherits System.Windows.Forms.Form
Dim max As Short, bid As String, id As String
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
On Error Resume Next
Me.Location = New Point(50, 20)
maxid()
TextBox7.Text = Today
TextBox8.Text = TimeOfDay
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
On Error Resume Next
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
TextBox8.Clear()
TextBox9.Clear()
TextBox10.Clear()
TextBox7.Text = Today
TextBox8.Text = TimeOfDay
maxid()
End Sub
Public Sub maxid()
On Error Resume Next
s = "select max(id) from book"
e As
"','" &
"','" &
"','" &
End Sub
Private Sub TextBox5_KeyPress(ByVal sender As Object,
System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress
If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then
e.Handled = True
End If
End Sub
ByVal
As
ByVal
As
ByVal
As
ByVal
As
e.Handled = True
End If
End Sub
Private Sub TextBox3_KeyPress(ByVal sender As Object,
System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress
If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then
e.Handled = True
End If
End Sub
ByVal
As
ByVal
As
Imports System.Data.OleDb
Public Class Form6
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
On Error Resume Next
s = "select bookid from studentissue where bookid='" & ComboBox1.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
MsgBox("Cannot delete Book is issued", MsgBoxStyle.Information)
Exit Sub
End If
s = "select book_id from teacherissue where book_id='" & ComboBox1.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
MsgBox("Cannot delete Book is issued", MsgBoxStyle.Information)
Else
s = "delete from book where bookid='" & ComboBox1.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
MsgBox("Book deleted", MsgBoxStyle.Information)
End If
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
On Error Resume Next
s = "select * from book where bookid='" & ComboBox1.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
TextBox2.Text = ds.Tables(0).Rows(0)(1)
TextBox3.Text = ds.Tables(0).Rows(0)(2)
TextBox4.Text = ds.Tables(0).Rows(0)(3)
TextBox5.Text = ds.Tables(0).Rows(0)(4)
TextBox6.Text = ds.Tables(0).Rows(0)(5)
TextBox7.Text = ds.Tables(0).Rows(0)(6)
TextBox8.Text = ds.Tables(0).Rows(0)(7)
TextBox9.Text = ds.Tables(0).Rows(0)(8)
TextBox10.Text = ds.Tables(0).Rows(0)(9)
End Sub
Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
On Error Resume Next
s = "select bookid from book"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
For i = 0 To ds.Tables(0).Rows.Count - 1
ComboBox1.Items.Add(ds.Tables(0).Rows(i)(0))
Next
End If
End Sub
ADD STUDENT
Imports System.Data.OleDb
Public Class Form8
Inherits System.Windows.Forms.Form
Dim gen As String, max As Short, card As String
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button6.Click
On Error Resume Next
If TextBox20.Text = "" Or TextBox21.Text = "" Or TextBox18.Text = "" Or _
ComboBox4.Text = "" Or RichTextBox1.Text = "" Or TextBox16.Text = "" Then
MsgBox("Incomplete Information", MsgBoxStyle.Information)
TextBox21.Focus()
Exit Sub
End If
If RadioButton1.Checked = True Then
gen = "male"
Else
gen = "female"
End If
s = "insert into student values('" & Trim(TextBox21.Text) & "','" & TextBox12.Text & "','"
& TextBox20.Text & "','" & ComboBox4.Text & "','" & gen & "','" & TextBox18.Text & "','" &
TextBox16.Text & "','" & RichTextBox1.Text & "','" & TextBox15.Text & "','" & TextBox14.Text
& "','" & TextBox11.Text & "'," & max & ")"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
MsgBox("Student Record added", MsgBoxStyle.Information)
Button5.PerformClick()
maxno()
End Sub
Public Sub maxno()
On Error Resume Next
s = "select max(cno) from student"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
If IsDBNull(ds.Tables(0).Rows(0)(0)) = False Then
max = ds.Tables(0).Rows(0)(0)
Else
max = 0
End If
Else
max = 0
End If
max = max + 1
If max < 10 Then
card = "LBM-0" & max
Else
card = "LBM-" & max
End If
TextBox12.Text = card
End Sub
Private Sub Form8_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
On Error Resume Next
Me.Location = New Point(100, 20)
maxno()
End Sub
ByVal
As
ByVal
As
e.Handled = True
End If
End Sub
Private Sub TextBox14_KeyPress(ByVal sender As Object,
System.Windows.Forms.KeyPressEventArgs) Handles TextBox14.KeyPress
If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then
e.Handled = True
End If
End Sub
ByVal
As
ByVal
As
ByVal
As
ByVal
As
DELETE STUDENT
mports System.Data.OleDb
Public Class Form9
Inherits System.Windows.Forms.Form
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
Me.Close()
End Sub
Private Sub Form9_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
On Error Resume Next
Me.Location = New Point(80, 20)
s = "select rollno from student"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
For i = 0 To ds.Tables(0).Rows.Count - 1
ComboBox3.Items.Add(ds.Tables(0).Rows(i)(0))
Next
End If
s = "select cardno from student"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
For i = 0 To ds.Tables(0).Rows.Count - 1
ComboBox4.Items.Add(ds.Tables(0).Rows(i)(0))
Next
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
On Error Resume Next
s = "select rollno from student where rollno='" & ComboBox3.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
MsgBox("Cannot delete student", MsgBoxStyle.Information)
Else
s = "delete from student where bookid='" & ComboBox3.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
TextBox10.Text = ds.Tables(0).Rows(0)(10)
End Sub
End Class
ADD TEACHER
Imports System.Data.OleDb
Public Class Form10
Inherits System.Windows.Forms.Form
Dim gen As String, max As Short, card As String
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
Private Sub Label12_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label12.Click
End Sub
Private Sub Form10_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
maxno()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
On Error Resume Next
TextBox2.Clear()
'
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
TextBox8.Clear()
TextBox9.Clear()
End Sub
Public Sub maxno()
s = "insert into teacher values('" & TextBox1.Text & "','" & ComboBox1.Text & "','" &
TextBox2.Text & "','" & gen & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" &
TextBox6.Text & "','" & TextBox7.Text & "','" & TextBox8.Text & "','" & TextBox9.Text & "'," &
max & ")"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
MsgBox("Teacher record added", MsgBoxStyle.Information)
maxno()
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
End Sub
Private Sub TextBox2_KeyPress(ByVal sender As Object,
System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then
e.Handled = True
End If
End Sub
ByVal
As
ByVal
As
ByVal
As
ByVal
As
End If
End Sub
Private Sub TextBox9_KeyPress(ByVal sender As Object,
System.Windows.Forms.KeyPressEventArgs) Handles TextBox9.KeyPress
If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then
e.Handled = True
End If
End Sub
End Class
DELETE TEACHER
ByVal
As
Imports System.Data.OleDb
Public Class Form11
Inherits System.Windows.Forms.Form
End Sub
End Class
CHANGE PASSWORD
Imports System.Data.OleDb
Public Class Form14
Inherits System.Windows.Forms.Form
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
On Error Resume Next
If TextBox1.Text = "" Or TextBox2.Text = "" Or ComboBox1.Text = "" Then
MsgBox("Incomplete Information", MsgBoxStyle.Information)
Exit Sub
End If
If Len(TextBox3.Text) < 6 Then
MsgBox("Password should be atleast six characters", MsgBoxStyle.Information)
TextBox3.Focus()
Exit Sub
End If
s = "select * from login where username='" & Trim(TextBox1.Text) & "'and pass='" &
Trim(TextBox2.Text) & "'and type='" & ComboBox1.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
If TextBox3.Text = TextBox4.Text Then
s = "update login set pass='" & TextBox3.Text & "' where username='" &
Trim(TextBox1.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
MsgBox("Password changed", MsgBoxStyle.OKOnly)
Else
USER LOGIN
Imports System.Data.OleDb
Public Class Form15
Inherits System.Windows.Forms.Form
Private Sub Form15_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
ComboBox1.Text = "Administrator"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
On Error Resume Next
If TextBox1.Text = "" Or TextBox2.Text = "" Or ComboBox1.Text = "" Then
MsgBox("Incomplete Information", MsgBoxStyle.Information)
Exit Sub
End If
s = "select * from login where username='" & Trim(TextBox1.Text) & "'and pass='" &
Trim(TextBox2.Text) & "'and type='" & ComboBox1.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
If ComboBox1.Text = "Administrator" Then
us = "ad"
Else
us = "user"
End If
Me.Hide()
Dim f As New Form7()
f.ShowDialog()
Else
MsgBox("Invalid user name or password or type", MsgBoxStyle.Information)
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class
EDIT STUDENT
Imports System.Data.OleDb
Public Class Form16
Inherits System.Windows.Forms.Form
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
Me.Close()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox5.Clear()
TextBox7.Clear()
TextBox8.Clear()
TextBox9.Clear()
TextBox10.Clear()
RichTextBox1.Clear()
End Sub
Private Sub Form16_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
On Error Resume Next
s = " select rollno from student"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
For i = 0 To ds.Tables(0).Rows.Count - 1
ComboBox3.Items.Add(ds.Tables(0).Rows(i)(0))
Next
End If
s = " select cardno from student"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
For i = 0 To ds.Tables(0).Rows.Count - 1
ComboBox4.Items.Add(ds.Tables(0).Rows(i)(0))
Next
End If
End Sub
Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ComboBox3.SelectedIndexChanged
On Error Resume Next
s = "select * from student where rollno ='" & ComboBox3.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
ComboBox4.Text = ds.Tables(0).Rows(0)(1)
RichTextBox1.Text = ds.Tables(0).Rows(0)(7)
TextBox1.Text = ds.Tables(0).Rows(0)(4)
TextBox2.Text = ds.Tables(0).Rows(0)(3)
TextBox3.Text = ds.Tables(0).Rows(0)(2)
TextBox5.Text = ds.Tables(0).Rows(0)(5)
TextBox7.Text = ds.Tables(0).Rows(0)(6)
TextBox8.Text = ds.Tables(0).Rows(0)(8)
TextBox9.Text = ds.Tables(0).Rows(0)(9)
TextBox10.Text = ds.Tables(0).Rows(0)(10)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
On Error Resume Next
s = " update student set sname = '" & TextBox3.Text & "', gender = '" & TextBox1.Text &
"', class = '" & TextBox2.Text & "', city = '" & TextBox5.Text & "',distt = '" & TextBox7.Text &
"',phoneno = '" & TextBox8.Text & "', mobileno = '" & TextBox9.Text & "', email = '" &
TextBox10.Text & "', address = '" & RichTextBox1.Text & "' where rollno = '" &
ComboBox3.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
MsgBox("Student Record Updated", MsgBoxStyle.Information)
End Sub
Private Sub ComboBox4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ComboBox4.SelectedIndexChanged
On Error Resume Next
s = "select * from student where cardno ='" & ComboBox4.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
ComboBox3.Text = ds.Tables(0).Rows(0)(0)
RichTextBox1.Text = ds.Tables(0).Rows(0)(7)
TextBox1.Text = ds.Tables(0).Rows(0)(4)
TextBox2.Text = ds.Tables(0).Rows(0)(3)
TextBox3.Text = ds.Tables(0).Rows(0)(2)
TextBox5.Text = ds.Tables(0).Rows(0)(5)
TextBox7.Text = ds.Tables(0).Rows(0)(6)
TextBox8.Text = ds.Tables(0).Rows(0)(8)
TextBox9.Text = ds.Tables(0).Rows(0)(9)
TextBox10.Text = ds.Tables(0).Rows(0)(10)
End Sub
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then
e.Handled = True
End If
End Sub
ByVal
As
ByVal
As
ByVal
As
ByVal
As
ByVal
As
EDIT TEACHER
Imports System.Data.OleDb
Public Class Form17
Inherits System.Windows.Forms.Form
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
TextBox1.Clear()
TextBox2.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
TextBox8.Clear()
TextBox9.Clear()
TextBox10.Clear()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
On Error Resume Next
s = " update teacher set department = '" & TextBox1.Text & "', firstname = '" &
TextBox2.Text & "', gender = '" & TextBox10.Text & "', address = '" & TextBox4.Text & "', city
= '" & TextBox5.Text & "', distt = '" & TextBox6.Text & "', e_mail = '" & TextBox7.Text & "',
phnumber = '" & TextBox8.Text & "', mobnumber = '" & TextBox9.Text & "' where teacher_id
= '" & ComboBox1.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
MsgBox("Teacher Record Updated", MsgBoxStyle.Information)
End Sub
Private Sub Form17_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
On Error Resume Next
s = "select teacher_id from teacher"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
For i = 0 To ds.Tables(0).Rows.Count - 1
ComboBox1.Items.Add(ds.Tables(0).Rows(i)(0))
Next
End If
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
On Error Resume Next
s = "select * from teacher where teacher_id ='" & ComboBox1.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
TextBox1.Text = ds.Tables(0).Rows(0)(1)
TextBox2.Text = ds.Tables(0).Rows(0)(2)
'TextBox3.Text = ds.Tables(0).Rows(0)(3)
TextBox10.Text = ds.Tables(0).Rows(0)(3)
TextBox4.Text = ds.Tables(0).Rows(0)(4)
TextBox5.Text = ds.Tables(0).Rows(0)(5)
TextBox6.Text = ds.Tables(0).Rows(0)(6)
TextBox7.Text = ds.Tables(0).Rows(0)(7)
TextBox8.Text = ds.Tables(0).Rows(0)(8)
TextBox9.Text = ds.Tables(0).Rows(0)(9)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object,
System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
Private Sub TextBox1_KeyPress(ByVal sender As Object,
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then
e.Handled = True
End If
End Sub
Private Sub TextBox2_KeyPress(ByVal sender As Object,
System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then
e.Handled = True
End If
End Sub
Private Sub TextBox5_KeyPress(ByVal sender As Object,
System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress
If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then
e.Handled = True
End If
End Sub
Private Sub TextBox6_KeyPress(ByVal sender As Object,
System.Windows.Forms.KeyPressEventArgs) Handles TextBox6.KeyPress
If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then
e.Handled = True
End If
End Sub
Private Sub TextBox10_KeyPress(ByVal sender As Object,
System.Windows.Forms.KeyPressEventArgs) Handles TextBox10.KeyPress
ByVal e As
ByVal
As
ByVal
As
ByVal
As
ByVal
As
ByVal
As
ByVal
As
ByVal
As
EDIT BOOK
Imports System.Data.OleDb
Public Class Form18
Inherits System.Windows.Forms.Form
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
TextBox8.Clear()
TextBox9.Clear()
End Sub
Private Sub Form18_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
On Error Resume Next
s = "select bookid from book"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
For i = 0 To ds.Tables(0).Rows.Count - 1
ComboBox1.Items.Add(ds.Tables(0).Rows(i)(0))
Next
End If
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
On Error Resume Next
s = "select * from book where bookid='" & ComboBox1.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
TextBox2.Text = ds.Tables(0).Rows(0)(1)
TextBox3.Text = ds.Tables(0).Rows(0)(2)
TextBox4.Text = ds.Tables(0).Rows(0)(3)
TextBox5.Text = ds.Tables(0).Rows(0)(4)
TextBox6.Text = ds.Tables(0).Rows(0)(5)
TextBox7.Text = ds.Tables(0).Rows(0)(6)
TextBox8.Text = ds.Tables(0).Rows(0)(7)
TextBox9.Text = ds.Tables(0).Rows(0)(8)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
On Error Resume Next
s = " update book set bname = '" & TextBox2.Text & "', aname = '" & TextBox3.Text & "',
publisher = '" & TextBox4.Text & "',cost = '" & TextBox5.Text & "', edition = '" &
TextBox6.Text & "', almirah = '" & TextBox9.Text & "' where bookid = '" & ComboBox1.Text
& "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
MsgBox("Book Record Updated", MsgBoxStyle.Information)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then
e.Handled = True
End If
End Sub
Private Sub TextBox3_KeyPress(ByVal sender As Object,
System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress
If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then
e.Handled = True
End If
End Sub
Private Sub TextBox4_KeyPress(ByVal sender As Object,
System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress
If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then
e.Handled = True
End If
End Sub
Private Sub TextBox5_KeyPress(ByVal sender As Object,
System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress
If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then
e.Handled = True
End If
End Sub
Private Sub TextBox9_KeyPress(ByVal sender As Object,
System.Windows.Forms.KeyPressEventArgs) Handles TextBox9.KeyPress
If Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) <= 123 Then
e.Handled = True
End If
End Sub
End Class
ByVal
As
ByVal
As
ByVal
As
ByVal
As
VIEW RECORDS
Imports System.Data.OleDb
Public Class Form19
Inherits System.Windows.Forms.Form
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button4.Click
Me.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
On Error Resume Next
s = "select * from book"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
DataGrid1.DataSource = ds
DataGrid1.DataMember = ds.Tables(0).ToString
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
On Error Resume Next
s = "select * from student"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
DataGrid1.DataSource = ds
DataGrid1.DataMember = ds.Tables(0).ToString
End Sub
Private Sub Form19_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
On Error Resume Next
s = "select * from teacher"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
DataGrid1.DataSource = ds
DataGrid1.DataMember = ds.Tables(0).ToString
End Sub
End Class
STUDENT SEARCH
Imports System.Data.OleDb
Public Class Form20
Inherits System.Windows.Forms.Form
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox2.Focus()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
On Error Resume Next
If Not TextBox2.Text = "" Then
s = "select * from student where rollno ='" & Trim(TextBox2.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count <= 0 Then
MsgBox("Name not exists", MsgBoxStyle.Information)
TextBox2.Focus()
Exit Sub
Else
TextBox1.Text = ds.Tables(0).Rows(0)(2)
TextBox3.Text = ds.Tables(0).Rows(0)(3)
TextBox4.Text = ds.Tables(0).Rows(0)(1)
TextBox5.Text = ds.Tables(0).Rows(0)(7)
End If
End If
If Not TextBox4.Text = "" Then
s = "select * from student where cardno ='" & Trim(TextBox4.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count <= 0 Then
MsgBox("Name not exists", MsgBoxStyle.Information)
TextBox4.Focus()
Exit Sub
Else
TextBox1.Text = ds.Tables(0).Rows(0)(2)
TextBox3.Text = ds.Tables(0).Rows(0)(3)
TextBox2.Text = ds.Tables(0).Rows(0)(0)
TextBox5.Text = ds.Tables(0).Rows(0)(7)
End If
End If
End Sub
Private Sub Form20_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
End Sub
End Class
TEACHER SEARCH
Imports System.Data.OleDb
Public Class Form21
Inherits System.Windows.Forms.Form
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
TextBox8.Clear()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
On Error Resume Next
If Not TextBox2.Text = "" Then
s = "select * from teacher where teacher_id='" & Trim(TextBox2.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count <= 0 Then
MsgBox("Invalid Library card number", MsgBoxStyle.Information)
TextBox2.Focus()
Exit Sub
Else
TextBox1.Text = ds.Tables(0).Rows(0)(2)
TextBox3.Text = ds.Tables(0).Rows(0)(1)
TextBox4.Text = ds.Tables(0).Rows(0)(5)
TextBox5.Text = ds.Tables(0).Rows(0)(6)
TextBox6.Text = ds.Tables(0).Rows(0)(8)
TextBox7.Text = ds.Tables(0).Rows(0)(9)
TextBox8.Text = ds.Tables(0).Rows(0)(10)
End If
End If
End Sub
Private Sub Form21_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
End Sub
End Class
BOOK SEARCH
Imports System.Data.OleDb
Public Class Form22
Inherits System.Windows.Forms.Form
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
TextBox7.Clear()
TextBox8.Clear()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
On Error Resume Next
If Not TextBox2.Text = "" Then
s = "select * from book where bookid ='" & Trim(TextBox2.Text) & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count <= 0 Then
MsgBox(" Teacher not exists", MsgBoxStyle.Information)
TextBox2.Focus()
Exit Sub
Else
TextBox1.Text = ds.Tables(0).Rows(0)(1)
TextBox3.Text = ds.Tables(0).Rows(0)(2)
TextBox4.Text = ds.Tables(0).Rows(0)(3)
TextBox5.Text = ds.Tables(0).Rows(0)(4)
TextBox6.Text = ds.Tables(0).Rows(0)(5)
TextBox7.Text = ds.Tables(0).Rows(0)(8)
TextBox8.Text = ds.Tables(0).Rows(0)(9)
End If
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
Private Sub Form22_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
End Sub
End Class
DELETE USER
Imports System.Data.OleDb
Public Class Form23
Inherits System.Windows.Forms.Form
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
TextBox1.Clear()
TextBox2.Clear()
TextBox1.Focus()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
On Error Resume Next
If TextBox1.Text = "" Or ComboBox1.Text = "" Then
MsgBox("Incomplete Information", MsgBoxStyle.Information)
Exit Sub
End If
s = "select * from login where username='" & Trim(TextBox1.Text) & "'and pass='" &
TextBox2.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
s = "delete from login where username='" & Trim(TextBox1.Text) & "'and pass='" &
TextBox2.Text & "'"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
MsgBox("User Deleted", MsgBoxStyle.Information)
Else
MsgBox("Invalid user name or password or type", MsgBoxStyle.Information)
End If
End Sub
Private Sub Form23_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
On Error Resume Next
ComboBox1.Items.Clear()
If us = "ad" Then
ComboBox1.Items.Add("Administrator")
ComboBox1.Items.Add("User")
Else
ComboBox1.Items.Add("User")
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
End Class
CREATE NEW PASSWORD
Imports System.Data.OleDb
Public Class Form24
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
On Error Resume Next
If TextBox1.Text = "" Or TextBox2.Text = "" Then
MsgBox("Incomplete Information", MsgBoxStyle.Information)
TextBox1.Focus()
Exit Sub
End If
If Len(TextBox2.Text) < 6 Then
MsgBox("Password should be atleast six characters", MsgBoxStyle.Information)
TextBox2.Focus()
Exit Sub
End If
If Not TextBox2.Text = TextBox3.Text Then
MsgBox("Passwprd not matched", MsgBoxStyle.Information)
TextBox2.Focus()
Exit Sub
End If
s = "insert into login values('" & Trim(TextBox1.Text) & "','" & Trim(TextBox2.Text) &
"','" & Trim(ComboBox1.Text) & "')"
da = New OleDbDataAdapter(s, dc)
ds = New DataSet()
da.Fill(ds)
MsgBox("User added", MsgBoxStyle.Information)
End Sub
Private Sub Form24_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
On Error Resume Next
ComboBox1.Items.Clear()
If us = "ad" Then
ComboBox1.Items.Add("Administrator")
ComboBox1.Items.Add("User")
Else
ComboBox1.Items.Add("User")
End If
End Sub
End Class
LOADING FORM
Public Class Form25
Inherits System.Windows.Forms.Form
Dim i As Integer
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Timer1.Tick
On Error Resume Next
i=i+1
ProgressBar1.Value = ProgressBar1.Value + 10
If i = 10 Then
Timer1.Enabled = False
Me.Hide()
Dim f As New Form15()
f.ShowDialog()
End If
End Sub
Private Sub Form25_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
On Error Resume Next
PictureBox1.Image = Image.FromFile("2.jpg")
End Sub
End Class
ADD BOOK
ADD STUDENT
ADD TEACHER
ADD USER
SEARCH BOOK
CHANGE PASSWORD
DELETE BOOK
DELETE STUDENT
DELETE TEACHER
DELETE USER
EDIT BOOK
EDIT STUDENT
STUDENT ISSUE
STUDENT RETURN
STUDENT SEARCH
TEACHER ISSUE
USER LOGIN
VIEW RECORDS