You are on page 1of 154

PROJECT REPORT ON

BLOOD DONATION SYSTEM

SUBMITTED IN PARTIAL FULFILLMENT OF THE


REQUIREMENTS
FOR THE AWARD OF THE DEGREE OF

BACHELOR OF COMPUTER APPLICATION

SUBMITTED BY:
YASHVEER SINGH

ENROLMENT NO:836086
ROLL NO: 802271

SUBMITTED TO
MR. PRABHAT RANJAN SHARMA
(H.O.D.)
Department of computer science

UNDER THE SUPERVISION OF


MR. MOHIT KUMAR VARSHNEY
(Lecturer)

INSTITUTE OF INFORMATIONMANAGMENT &


TECHNOLOGY
RAMGHAT ROAD, ALIGARH 202001

(AFFILIATED TO DR. B. R. AMBEDKAR UNIVERSITY, AGRA)

1
2008-2011

INSTITUTE OF INFORMATION MANAGEMENT


AND TECHNOLOGY ALIGARH

ACKNOWLEDGEMENT

We have great pleasure in acknowledgement the help from al those

who favored me in having shape to the present project. We take the

responsibility to express our sincere and deep sense of gratitude to our

head of department Mr. Prabhat Ranjan Sharma director of our

college Mr. D.S. Mahalwar and Dean S.K.N. Singh. Our facility

members and all our friends. We pay our thanks to Mr. Mohit

Kumar Varshney for providing a great support to us. They guided

our project team efficient and good working.

We like to pay our wish and love to our all supporting friends who

made their best efforts to help us. Words defeat us in expressing

2
thanks to our family members for providing moral support and

encouragement during the tenure of the project.

We hope and wish to be blessed with the blessing and encouragement

from all of the above in our future to accomplish all our endeavors.

YASHVEER SINGH
(B.C. A. VI Sem)

DECLARATION

th
I Yashveer Singh Roll No. 802271 student of BCA 6 semester in

institute of Information Management and technology (IIMT), Aligarh

here by declare that the project report titled “BLOOD

3
DONATION SYSTEM” is not submitted for the award of any

other diploma or degree.

Place: Name

Date: Yashveer Singh

Document information:

4
Project code B.C.A.

Project Name BLOOD DONATION


SYSTEM
Location IIMT

Submitted to Mr. PRABHAT RANJAN


SHARMA
Under the supervision of Mr. MOHIT KUMAR
VARSHNEY
Technical Member YASHVEER SINGH

5
Table of contents:

1. INTRODUCTION

2. SYSTEM DEVELOPMENT

2.1) Initial investigation

2.2) Opportunities of the system:

3.) SYSTEM ANALYSIS

3.1) what is the problem?

3.2) Feasibility Study

3.2.1) Technical feasibility

3.2.2) Economical feasibility

3.2.3) Operational feasibility

3.3) System Interface


3.3.1) User Interface

3.3.2) Hardware Interface

6
3.3.3) Software Interface

3.3.4) Communication Interface

3.3.5) Memory Constraints

3.4) Problem Statement

3.5) Object Modeling

3.5.1) Object Modeling

3.6) Dynamic Model

4.) DATABASE TABLE

5.) FORM DESIGNING

6.) CODING

7.) CONCLUSION

7
8.) FUTURE SCOPE

9.) BIBLIOGRAPHY

HISTORY OF VISUAL BASIC

8
HISTORY OF VISUAL BASIC

VB 1.0 was introduced in 1991. The drag and drop design for
creating the user interface is derived from a prototype form
generator developed by Alan Cooper and his company called
Tripod. Microsoft contracted with Cooper and his associates to
develop Tripod into a programmable form system for Windows 3.0,
under the code name Ruby.

Tripod did not include a programming language at all. Microsoft


decided to combine Ruby with the Basic language to create Visual
Basic.

The Ruby interface generator provided the "visual" part of Visual


Basic and this was combined with the "EB" Embedded BASIC

9
engine designed for Microsoft's abandoned "Omega" database
system. Ruby also provided the ability to load dynamic link libraries
containing additional controls (then called "gizmos"), which later
became the VBX interface

Visual Basic (VB) is the third-generation event-driven


programming language and integrated development environment
(IDE) from Microsoft for its COM programming model. Visual
Basic is relatively easy to learn and use.

Visual Basic was derived from BASIC and enables the

rapid application development (RAD) of graphical user interface


(GUI) applications, access to databases using Data Access Objects,
Remote Data Objects, or ActiveX Data Objects, and creation of
ActiveX controls and objects.

Scripting languages such as VBA and VBScript are syntactically


similar to Visual Basic, but perform differently.

A programmer can put together an application using the components


provided with Visual Basic itself. Programs written in Visual Basic
can also use the Windows API, but doing so requires external
function declarations.

10
Visual Basic is a "visual programming" environment for developing

Windows (also Web now) applications. Visual Basic makes it

possible to develop complicated applications very quickly. The

programmer designs windows graphically, drags program elements

from the Visual Basic Toolbox and writes basic code for each element.

Visual Basic is "event-driven" which means that procedures are called

automatically when the end user chooses menu items, clicks the

mouse, moves objects on the screen, etc.

11
CHARACTERSTICS OF VISUAL BASIC

CHARACTERSTICS OF VISUAL BASIC

VISUAL BASIC is a high level programming language which

evolved from the earlier DOS version called BASIC. BASIC means

Beginners' All-purpose Symbolic Instruction Code. It is a very easy

programming language to learn. The code look a lot like English

12
Language. Different software companies produced different versions

of BASIC, such as Microsoft QBASIC, QUICKBASIC, GWBASIC

,IBM BASICA and so on. However, people prefer to use Microsoft

Visual Basic today, as it is a well developed programming language

and supporting resources are available everywhere. Now, there are

many versions of VB exist in the market, the most popular one and

still widely used by many VB programmers is none other than Visual

Basic 6. We also have VB.net, VB2005, VB2008 and the latest

VB2010. Both Vb2008 and VB2010 are fully object oriented

programming (OOP) language.

VISUAL BASIC is a VISUAL and events driven Programming


Language. These are the main divergence from the old BASIC. In
BASIC, programming is done in a text-only environment and the
program is executed sequentially. In VB, programming is done in a
graphical environment. In the old BASIC, you have to write
program code for each graphical object you wish to display it on
screen, including its position and its color. However, In VB , you
just need to drag and drop any graphical object anywhere on the
form, and you can change its color any time using the properties
windows.

13
On the other hand, because the user may click on a certain object
randomly, so each object has to be programmed independently to be
able to response to those actions (events). Therefore, a VB Program
is made up of many subprograms, each has its own program code,
and each can be executed independently and at the same time each
can be linked together in one way or another.

Like the BASIC programming language, Visual Basic was designed to

be easily learned and used by beginner programmers. The language

not only allows programmers to create simple GUI applications, but

can also develop complex applications. Programming in VB is a

combination of visually arranging components or controls on a form,

specifying attributes and actions of those components, and writing

additional lines of code for more functionality. Since default attributes

and actions are defined for the components, a simple program can be

created without the programmer having to write many lines of code.

Performance problems were experienced by earlier versions, but with

faster computers and native code compilation this has become less of

an issue.

14
Forms are created using drag-and-drop techniques. A tool is used to
place controls (e.g., text boxes, buttons, etc.) on the form (window).
Controls have attributes and event handlers associated with them.
Default values are provided when the control is created, but may be
changed by the programmer. Many attribute values can be modified
during run time based on user actions or changes in the
environment, providing a dynamic application. For example, code
can be inserted into the form resize event handler to reposition a
control so that it remains centered on the form, expands to fill up the
form, etc. By inserting code into the event handler for a keypress in
a text box, the program can automatically translate the case of the
text being entered, or even prevent certain characters from being
inserted.

Visual Basic can create executables (EXE files), ActiveX controls,


or DLL files, but is primarily used to develop Windows applications
and to interface database systems. Dialog boxes with less
functionality can be used to provide pop-up capabilities. Controls
provide the basic functionality of the application, while
programmers can insert additional logic within the appropriate event
handlers. For example, a drop-down combination box will
automatically display its list and allow the user to select any
element. An event handler is called when an item is selected, which
can then execute additional code created by the programmer to

15
perform some action based on which element was selected, such as
populating a related list.

1.) INTRODUCTION

16
1.2) PURPOSE:

1.3) SCOPE:

1.4) INTENDED AUDIENCE:

1.5) USER CHARACTERISTICS:

1.6) CONSTRAINT:

1.7) ASSUMPTIONS AND DEPENDENCIES:

1.8) SPECIFIC REQUIREMENTS:

1.8.1) External Interface Requirements:

1.8.2) Functional Requirement / System features:

1.8.3) Performance / Acceptance Requirements:

1.8.4) Acceptance Criteria:

1.8.5) Design Constraints:

1.9) Software System Attributes:

17
1.9.1) Usability:

1.9.2) Efficiency:

1.9.3) Maintainability:

1.9.4) Security:

1.9.5) Reliability:

1.9.6) Performance:

18
1. INTRODUCTION

1.5) PURPOSE:

The basic purpose of the system is to manage the transaction that

occurs during the operation as well as performing calculation

and updating database as and when necessary. The system is can

also provide the reports about current state of the student

Information.

19
1.6) SCOPE:

• The scope of this project is in the various Library that need to

manage their data about their transaction and services efficiently

and effectively.

• This project with the slight variations can be enhanced to be

used in the other systems which need to manage the quick data

processing.(more)

1.7) INTENDED AUDIENCE:

1. Management of the college .

2. Faculty members

3. Administrative staff

4. Student of the college

1.5) USER CHARACTERISTICS:

20
The system requires he user to be familiar with the basic

operations of computer.

1.6) CONSTRAINT:

This subsection of the Library Information system should

describe any other books that will limit the developer’s options.

These include:

1) Developers should have Knowledge of Visual Basic to

Develop a system

Like this.

2) Developers should have known about all the main devices and

there

Specification.

1.8) ASSUMPTIONS AND DEPENDENCIES:

1) Project will work for a long time and user will adopt it.

2) Project will work with very less maintenance requirement.

21
3) The database update made by the system will always leave

the system in consistent state.

4) There may be some small problems, which will not affect the

system performance, and these will be removed easily.

1.8) SPECIFIC REQUIREMENTS:

1.8.4) External Interface Requirements:

No External Interface Requirement

1.8.5) Functional Requirement / System features:

Preferences

This project is based upon Visual Basic user interfaces. The user

of this project is any computer literate person handling the Information

of the Library. The developer should be needed only when some

problem occurs in the operation of the system.

22
Login Process

This system interface is used to give access to the user for the

system, and mean while maintaining the security of th system.

1.8.6) Performance / Acceptance Requirements:

The project will be accepted if

1. The project works in its proper and specified way

2. No Major problem. This means that there is a problem in

performing a predefined, expecting task.

Any problem reported due to requirements not clear,

suggestions, “good to have”

Features and any enhancements/modification is not part of

the system acceptance.

1.8.4) Acceptance Criteria:

23
The user will use the system if it is giving the functionality it

promises (that is of automatically managing the data about the

daily records)

1.8.5) Design Constraints:

1) Work only in Standard conditions.

1.10) Software System Attributes:

1.9.1) Usability:

The system is fully usable and does not require any pre-specified

constraint to work properly.

1.9.2) Efficiency:

Hardware should me min. Pentium with 196 MB RAM.

(Fully efficient in the environments having less memory available and

a reasonable speed of execution)

1.9.3) Maintainability:

24
In case of any change in policies and rule of the institution using

the system, required changes will be made to the module written by

developer.

1.9.4) Security:

Only the super user can enter the system to use it.

1.9.5) Reliability:

System gives accurate result without any errors.

1.9.6) Performance:

The system itself is quiet fast.

25
2.) SYSTEM DEVELOPMENT

26
2.1) Initial investigation

2.2) Opportunities of the system:

2.) SYSTEM DEVELOPMENT

2.1) Initial investigation:

There is a system, which is concerned with the student and their

Information that is service and maintaining the record of the students.

27
In this system the data, which is about the student , maintaining

on the paper that is this system is based on paperwork.

We will define a transaction as the occurrence due to which the

current state of the system changes. It means that some updating of

data or the information changes.

The problems in paper –based system were:

1) slow and error prone data entry

2) Difficulties in data retrieval

3) Difficulties to manage a long record

4) Calculations are made by human; therefore there

is less accuracy in data transaction calculations.

2.2) Opportunities of the system:

28
The existing system can be replaced by computer-

based system, which can perform all the related tasks of

business in a better and efficient way. The alternative

computer based system can provide many facilities over

present paper based system in the following manner.

1) The data entry in a new computer based system will be fast

2) Easy and fast data retrieval

3) Long records can be managed easily

4) Computer does calculations, which improve accuracy.

3.) SYSTEM ANALYSIS

29
3.1) what is the problem?

3.2) Feasibility Study

3.2.4) Technical feasibility

3.2.5) Economical feasibility

3.2.6) Operational feasibility

3.3) System Interface


3.3.1) User Interface

3.3.2) Hardware Interface

3.3.3) Software Interface

3.3.4) Communication Interface

3.3.5) Memory Constraints

3.4) Problem Statement

3.5) Object Modeling

3.5.1) Object Modeling

3.6) Dynamic Model

30
3.) SYSTEM ANALYSIS

3.1) What is the problem?

In this way we realize that the new system is required

and will certainly improve the performance of the exiting

system over the exiting paper based system.

1. Design the system to develop the alternative

computer based system

2. To understand the user characteristics

3. Design a system for a particular types of user

3.1.2) Information about student:

31
There is the following information required to store for

student

3.2) Feasibility Study:

Feasibility study is the most important work of an analyst in

which the opportunities of problem solving are considered and it

is mainly considered that the problem is solved for the

organization or not. Following feasibility analysis of our system

are given below

3.2.1) Technical Feasibility:

The key question of the technical feasibility is “can the

work for the project be done with current equipment, exiting

32
software technology, and available personnel? If new technology

is required, what is the likelihood that it can be developed?

Our system requirement in the direction of technical

feasibility is feasible as per following:

1) Our system in run for a single user and it require no

more knowledge about computer system and it can be run by the

user with having small knowledge of computer.

2) Our front end of the computer system is visual Basic

which is free of cost and sufficient to provide the user friendly

environment.

3) For the back end of computer system as database

Microsoft access is chosen that is not free of cost but it is fit in the

expenditure of the origination and it can sufficiently manage the

database in very efficiently and fast way.

3.2.2) Economical Feasibility:

33
The key question of the economical feasibility is ”Are there

sufficient benefits In creating the system to make the costs

acceptable? Are the cost of not creating the system so that the

project must be undertaken?”

Our system requirements in the direction of economical

feasibility are feasible as per following:

2) Our system is developed in the Visual Basic

which is a free source and available for everyone.

3) The back end used in our system is Microsoft

Access that is not free of cost but it is fit in the expenditure of the

organization.

3.2.3) Operational Feasibility:

The key question of the operational feasibility is

“Will the system be used if it is developed and

34
implemented? Will there be resistance from users that

will undermine the possible application benefits?”

Our system requirements in the direction of

operational feasibility are feasible as per following:

1) The present system is paper based which have a

lot of problems which can be overcome by replacing it by our new

system and work with it

2) There may be some problems in the system faced

by the user can communicate with the origination to inform the

difficulties which will be solved immediately.

3.3) System Interfaces:

3.3.1) User Interface:

35
The Library is the system developed for the students

to Providing the information’s. It is a multi user system these are

the owner and other workers. The user interface to the system is

very easy, as it will be implemented by easy software, which can

be used effectively, and efficiently.

3.3.2 Hardware Interface:

Min. (64) MB RAM

Key Board

Mouse

3.3.3 Software Interface:

• Visual Basic 6.0

• Microsoft Access used as back –end to store the

database.

3.3.4 Communication Interface:

36
Verbal communication takes place between the

system user (student) and student of the Library. The

communication of user to the computer system will be very

easy and user will get correct information. Student will not

directly communicate with the computer system but he/she

will feel the effect of the computer

System over existing paper-based system, as it will

provide fast processing and accurate calculations.

3.3.5 Memory Constraints:

• Min. (64) MB RAM

• Min. 70 KB free hard disk

3.4 Problem Statement:

This the very first phase of project development in this

phase the user provides his requirements in the form of a problem

statement specifying the features of required system.

37
Problem statement of our project is as follows:

Design a system that will automate the transaction

processing. This system will be used by single user of the Library

information and this should provide for the entries of new student

as well as keeping track of what service has been given to student

and which of them are available. This system should provide

measures for maintaining the security and should be easy to use.

The sole user of the system will also enter records for the students

and their information.

3.5) Object Modeling:

Object modeling is done by to handle the real life

problems in which object and classes are mainly

emphasized. We insist upon what is being affected rather

than what is being done.

There are three phases of object modeling:

38
1) Object Modeling

2) Dynamic modeling

3) Functional Modeling

3.5.1) Object Modeling:

Object modeling is done to find all the objects and

relation among them like (association, generalization

etc.)

A) OBJECTS OF THE SYSTEM


There are several objects of our system, which are

given below after refining them and removing all other

unnecessary objects. Library, Owner, Students,

Service, traction etc are our main objects of the

system.

B) FINDING THE ASSOCIATIONS:

39
• Following associations are found in this system.

• Student goes to Library

• Library floor has an owner ( they may be only one)

• Student requests for the service to the owner

• Owner asks information from the Student.

• Owner issues the service.

• Library contains the record of the services provided to the

Student.

• Transaction updates the record.

• Owner initiates the transaction.

• Student returns the issues the books.

• Owner clears the record.

3.6) Dynamic Model:

40
Dynamic model show the time dependent behavior of

the system and the objects in it. We begin dynamic analysis

by looking for events external stimuli and responses. The

dynamic model is important for interactive systems.

Steps taken in dynamic modeling are:

 Prepare scenarios of typical interaction sequences

 Identify events between objects

 Prepare an events trace for each scenario

 Build a state diagram match events between objects to verify

consistency

A state is an abstraction of the attribute value and links of an

object. A state specifies the response of the object to input events. A

state corresponds to the interval between two events received by an

object. Events represents interval of time. A state has duration; it

41
occupies an interval of time. A state is often associated with a

continuous activity.

A state diagram is graph whose nodes are states and whose

directed arcs are transitions leveled by event names. A state is draw as

a round box containing an optional name. a transaction is draw as an

arrow from the receiving state to the target state.

42
5.) FORM DESIGNING

43
44
45
46
47
48
49
50
51
6.) Coding:

52
Coding:

FOR FORM-1

FOR PASSWORD:-
Private Sub command1_Click()
If txtpassword = "" Then
Form2.Show
Form1.Hide
Else
MsgBox "Sorry!!Invalid Password,Try Again"
txtpassword = ""
txtpassword.SetFocus
End If
End Sub

53
FOR FORM-2C:\Documents and Settings\GARIMA\My
Documents\Session 3 Ex-2_files

TO SHOW FORM’S:-
Private Sub mnubgwise_Click()
Form2.Hide
Form6.Show
End Sub
Private Sub mnudd_Click()
Form2.Hide
Form5.Show
End Sub
Private Sub mnudeleted_Click()
Form2.Hide
frmDeleteDeptt.Show
End Sub
Private Sub mnudu_Click()
Form2.Hide
Form4.Show
End Sub
Private Sub mnuexit_Click()
End
End Sub
Private Sub mnunr_Click()
Form2.Hide
Form3.Show
End Sub

54
FOR FORM-3

FOR SAVE RECORD:-


Private Sub command1_Click()
On Error GoTo myerror:
If text1 = "" Or text2 = "" Or Text3 = "" Or Text4 = "" Or Text5 = ""
Or Text6 = "" Or Combo1 = "" Or Combo2 = "" Or Combo3 = "" Or
Combo4 = "" Or Combo5 = "" Then
MsgBox "Fill up all fields"
Exit Sub
End If
Dim strsql As String
strsql = "Select * from registration"
Set rs = New ADODB.Recordset
rs.Open strsql, con, adOpenForwardOnly, adLockOptimistic
If MsgBox(" Are you sure(Y/N)???", 4) = 7 Then Exit Sub
rs.AddNew
If Not rs.EOF Then
rs.Fields("Donor ID") = text1.Text
rs.Fields("Name") = UCase$(text2.Text)
rs.Fields("Phone no") = (Text3.Text)
rs.Fields("E-mail ID") = (Text4.Text)
rs.Fields("Address") = UCase$(Text6.Text)
rs.Fields("Occupation") = UCase$(Combo1.Text)
rs.Fields("Blood Group") = UCase$(Combo2.Text)
rs.Fields("Department") = UCase$(Combo3.Text)
rs.Fields("Faculty") = UCase$(Combo4.Text)
rs.Fields("Hall") = UCase$(Combo5.Text)

55
rs.Fields("Enrollment no/Employee ID") = Text5.Text
rs.Update
End If
rs.Close
myerror:
Call error
End Sub

FOR CANCEL:-
Private Sub command2_Click()
text2.Text = Clear
Text3.Text = Clear
Text4.Text = Clear
Text5.Text = Clear
Text6.Text = Clear
Combo1.Text = Clear
Combo2.Text = Clear
Combo3.Text = Clear
Combo4.Text = Clear
Combo5.Text = Clear
text2.SetFocus
End Sub

FOR BACK:-
Private Sub Command3_Click()
text2.Text = Clear
Text3.Text = Clear
Text4.Text = Clear

56
Text5.Text = Clear
Text6.Text = Clear
Combo1.Text = Clear
Combo2.Text = Clear
Combo3.Text = Clear
Combo4.Text = Clear
Combo5.Text = Clear
text2.SetFocus
Form3.Hide
Form2.Show
End Sub

FOR DATA LINK:-


Private Sub Form_Load()
On Error GoTo myerror:
Set con = CreateObject("Adodb.connection")
con.Provider = "Microsoft.jet.oledb.4.0"
con.Open App.Path & "\db1.mdb"
Dim strsql As String
strsql = "Select distinct Faculty from registration"
Set rs = New ADODB.Recordset
rs.Open strsql, con, adOpenForwardOnly, adLockOptimistic
Combo1.AddItem "Student"
Combo1.AddItem "Employee"
Combo1.AddItem "Others"
While Not rs.EOF
Combo3.AddItem rs.Fields("Faculty")
rs.MoveNext

57
Wend
rs.Close
Dim strsql1 As String
strsql1 = "Select distinct Department from registration"
Set rs1 = New ADODB.Recordset
rs1.Open strsql1, con, adOpenForwardOnly, adLockOptimistic
While Not rs1.EOF
Combo4.AddItem rs1.Fields("Department")
rs1.MoveNext
Wend
rs1.Close
Dim strsql2 As String
strsql2 = "Select distinct Hall from registration"
Set rs2 = New ADODB.Recordset
rs2.Open strsql2, con, adOpenForwardOnly, adLockOptimistic
While Not rs2.EOF
Combo5.AddItem rs2.Fields("Hall")
rs2.MoveNext
Wend
rs2.Close
text1.Enabled = False
'Blood Group setting
Combo2.AddItem "A+"
Combo2.AddItem "A-"
Combo2.AddItem "B+"
Combo2.AddItem "B-"
Combo2.AddItem "O+"
Combo2.AddItem "O-"

58
Combo2.AddItem "AB+"
Combo2.AddItem "AB-"
myerror:
Call error
End Sub
Private Sub Form_Unload(Cancel As Integer)
con.Close
End Sub
Private Sub Text2_GotFocus()
On Error GoTo myerror:
Set rs3 = New ADODB.Recordset
rs3.Open "registration", con, adOpenForwardOnly, adLockOptimistic
If rs3.EOF = True Then
text1.Text = "D" & 1
GoTo ext:
End If
rs3.MoveLast
Dim strcode As String
strcode = rs3.Fields("Donor ID")
text1.Text = "D" & Val(Mid$(strcode, 2, Len(strcode) - 1)) + 1
ext:
rs3.Close
myerror:
Call error
End Sub
Private Sub error()
If Err.Number <> 0 Then
MsgBox ("Error: " & Err.Description)

59
Exit Sub
End If
End Sub

FOR FORM-4

GENERAL DECLARATION:-
Dim con As ADODB.Connection
FOR UPDATION:-
Private Sub command1_Click()
On Error GoTo myerror:
If text1 = "" Or text2 = "" Or Text3 = "" Or Text4 = "" Or Text5 = ""
Or Text6 = "" Or Combo1 = "" Or Combo2 = "" Or Combo3 = "" Or
Combo4 = "" Or Combo5 = "" Then
MsgBox "Fill up all fields"
Exit Sub
End If
Dim strsql As String
strsql = "Select * from registration where [Donor ID]='" & text1.Text
& "'"
Set rs = New ADODB.Recordset
rs.Open strsql, con, adOpenForwardOnly, adLockOptimistic
If MsgBox(" Are you sure(Y/N)???", 4) = 7 Then Exit Sub
rs.Update("Name") = text2.Text
rs.Update("Phone no") = Text3.Text
rs.Update("E-mail ID") = Text4.Text
rs.Update("Address") = Text5.Text
rs.Update("Occupation") = Combo1.Text

60
rs.Update("Blood Group") = Combo2.Text
rs.Close
MsgBox "Your change has been saved!!"
myerror:
Call error
End Sub

FOR CANCEL:-
Private Sub command2_Click()
text1.Text = Clear
text2.Text = Clear
Text3.Text = Clear
Text4.Text = Clear
Text5.Text = Clear
Combo1.Text = Clear
Combo2.Text = Clear
text1.SetFocus
Form4.Hide
Form2.Show
End Sub

FOR BACK:-
Private Sub Command3_Click()
text1.Text = Clear
text2.Text = Clear
Text3.Text = Clear
Text4.Text = Clear
Text5.Text = Clear

61
Combo1.Text = Clear
Combo2.Text = Clear
End Sub

FOR FORM:-
Private Sub Form_Load()
On Error GoTo myerror:
Set con = CreateObject("Adodb.connection")
con.Provider = "Microsoft.jet.oledb.4.0"
con.Open App.Path & "\db1.mdb"
Dim strsql As String
strsql = "Select distinct Faculty from registration"
Set rs = New ADODB.Recordset
rs.Open strsql, con, adOpenForwardOnly, adLockOptimistic
Combo1.AddItem "Student"
Combo1.AddItem "Employee"
Combo1.AddItem "Others"
While Not rs.EOF
Combo3.AddItem rs.Fields("Faculty")
rs.MoveNext
Wend
rs.Close
Dim strsql1 As String
strsql1 = "Select distinct Department from registration"
Set rs1 = New ADODB.Recordset
rs1.Open strsql1, con, adOpenForwardOnly, adLockOptimistic
While Not rs1.EOF
Combo4.AddItem rs1.Fields("Department")

62
rs1.MoveNext
Wend
rs1.Close
Dim strsql2 As String
strsql2 = "Select distinct Hall from registration"
Set rs2 = New ADODB.Recordset
rs2.Open strsql2, con, adOpenForwardOnly, adLockOptimistic
While Not rs2.EOF
Combo5.AddItem rs2.Fields("Hall")
rs2.MoveNext
Wend
rs2.Close
'Blood Group setting
Combo2.AddItem "A+"
Combo2.AddItem "A-"
Combo2.AddItem "B+"
Combo2.AddItem "B-"
Combo2.AddItem "O+"
Combo2.AddItem "O-"
Combo2.AddItem "AB+"
Combo2.AddItem "AB-"
myerror:
Call error
End Sub
Private Sub error()
If Err.Number <> 0 Then
MsgBox ("Error: " & Err.Description)
Exit Sub

63
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
con.Close
End Sub
Private Sub Text1_Change()
text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Combo1.Enabled = True
Combo2.Enabled = True
command1.Enabled = True
Label4.Enabled = True
Label5.Enabled = True
Label6.Enabled = True
Label7.Enabled = True
Label8.Enabled = True
Label9.Enabled = True
Label10.Enabled = True
Label11.Enabled = True
Label12.Enabled = True

Dim strsql10 As String


strsql10 = "Select * from registration where [Donor ID]='" &
text1.Text & "'"
Set rs10 = New ADODB.Recordset
rs10.Open strsql10, con, adOpenForwardOnly, adLockOptimistic

64
If Not rs10.EOF Then
text2.Text = rs10.Fields("Name")
Text3.Text = rs10.Fields("Phone no")
Text4.Text = rs10.Fields("E-mail ID")
Text5.Text = rs10.Fields("Address")
Combo1.Text = rs10.Fields("Occupation")
Combo2.Text = rs10.Fields("Blood Group")
End†f
rs10.Close
End Sub
Private Sub Text6_Change()
text1.Enabled = True
text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Combo1.Enabled = True
Combo2.Enabled = True
command1.Enabled = True
Label4.Enabled = True
Label5.Enabled = True
Label6.Enabled = True
Label7.Enabled = True
label3.Enabled = True
Label10.Enabled = True
Label11.Enabled = True
Label12.Enabled = True
Dim strsql11 As String

65
strsql11 = "Select * from registration where [Enrollment no/Employee
ID]='" & Text6.Text & "'"
Set rs11 = New ADODB.Recordset
rs11.Open strsql11, con, adOpenForwardOnly, adLockOptimistic
If Not rs11.EOF Then
text1.Text = rs11.Fields("Donor ID")
text2.Text = rs11.Fields("Name")
Text3.Text = rs11.Fields("Phone no")
Text4.Text = rs11.Fields("E-mail ID")
Combo1.Text = rs11.Fields("Occupation")
Combo2.Text = rs11.Fields("Blood Group")
End If
rs11.Close
End Sub

FOR FORM-5

GENERAL DECLARATION:-
Dim con As ADODB.Connection

FOR DELETION:-
Private Sub command1_Click()
On Error GoTo myerror:
Dim strsql As String
strsql = "Select * from registration where [Donor ID]='" & text1.Text
& "'"
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient

66
rs.Open strsql, con, adOpenForwardOnly, adLockOptimistic
If MsgBox(" Are you sure(Y/N)???", 4) = 7 Then Exit Sub
rs.Delete
rs.Close
MsgBox "Record Deleted!!"
Form2.Show
Form5.Hide
myerror:
End Sub
FOR BACK:-
Private Sub Command3_Click()
text1.Text = Clear
text2.Text = Clear
Text3.Text = Clear
Text4.Text = Clear
Text6.Text = Clear
Combo1.Text = Clear
Combo2.Text = Clear
text1.SetFocus
Form4.Hide
Form2.Show
End Sub

FOR CANCEL:-
Private Sub command2_Click()
text1.Text = Clear
text2.Text = Clear
Text3.Text = Clear

67
Text4.Text = Clear
Text5.Text = Clear
Combo1.Text = Clear
Combo2.Text = Clear
End Sub
Private Sub Form_Load()
On Error GoTo myerror:
Set con = CreateObject("Adodb.connection")
con.Provider = "Microsoft.jet.oledb.4.0"
con.Open App.Path & "\db1.mdb"
myerror:
Call error
End Sub
Private Sub error()
If Err.Number <> 0 Then
MsgBox ("Error: " & Err.Description)
Exit Sub
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
con.Close
End Sub
Private Sub Image2_Click()
End Sub
Private Sub Text1_Change()
text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True

68
Text5.Enabled = True
Combo1.Enabled = True
Combo2.Enabled = True
command1.Enabled = True
Label4.Enabled = True
Label5.Enabled = True
Label6.Enabled = True
Label7.Enabled = True
Label8.Enabled = True
Label9.Enabled = True
Label10.Enabled = True
Label11.Enabled = True
Label12.Enabled = True

Dim strsql10 As String


strsql10 = "Select * from registration where [Donor ID]='" &
text1.Text & "'"
Set rs10 = New ADODB.Recordset
rs10.Open strsql10, con, adOpenForwardOnly, adLockOptimistic
If Not rs10.EOF Then
text2.Text = rs10.Fields("Name")
Text3.Text = rs10.Fields("Phone no")
Text4.Text = rs10.Fields("E-mail ID")
Text5.Text = rs10.Fields("Address")
Combo1.Text = rs10.Fields("Occupation")
Combo2.Text = rs10.Fields("Blood Group")
End If

69
rs10.Close
End Sub
Private Sub Text6_Change()
text1.Enabled = True
text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Combo1.Enabled = True
Combo2.Enabled = True
command1.Enabled = True
Label4.Enabled = True
Label5.Enabled = True
Label6.Enabled = True
Label7.Enabled = True
Label8.Enabled = True
label3.Enabled = True
Label10.Enabled = True
Label11.Enabled = True
Label12.Enabled = True
Dim strsql11 As String
strsql11 = "Select * from registration where [Enrollment no/Employee
ID]='" & Text6.Text & "'"
Set rs11 = New ADODB.Recordset
rs11.Open strsql11, con, adOpenForwardOnly, adLockOptimistic
If Not rs11.EOF Then
text1.Text = rs11.Fields("Donor ID")
text2.Text = rs11.Fields("Name")

70
Text3.Text = rs11.Fields("Phone no")
Text4.Text = rs11.Fields("E-mail ID")
Text5.Text = rs11.Fields("Address")
Combo1.Text = rs11.Fields("Occupation")
Combo2.Text = rs11.Fields("Blood Group")
End If
rs11.Close
End Sub

FOR FORM-6
Dim con As ADODB.Connection
Dim selec As Integer
FOR SEARCH:-
Private Sub command1_Click()
On Error GoTo myerror:
Dim strsql As String
If Not Combo1.Text = "" Then
strsql = "SELECT registration.[Donor ID], registration.Name,
registration.[Phone no],registration.[E-mail
ID],registration.Address,registration.Occupation,registration.[Blood
Group] FROM registration WHERE [Blood Group]='" &
Combo1.Text & "'"
End If
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open strsql, con, adOpenForwardOnly, adLockOptimistic
Set DataGrid1.DataSource = rs

71
DataGrid1.Columns(0).Caption = "D.ID"
DataGrid1.Columns(0).Width = 500
DataGrid1.Columns(1).Width = 700
DataGrid1.Columns(2).Width = 1500
DataGrid1.Columns(3).Width = 2500
DataGrid1.Columns(4).Width = 2500
DataGrid1.Columns(5).Width = 500
DataGrid1.Columns(6).Width = 900
DataGrid1.Columns(7).Width = 2200
DataGrid1.Columns(8).Width = 2200
DataGrid1.Columns(9).Width = 1500
DataGrid1.Columns(10).Width = 900
DataGrid1.Refresh
'rs.Close
myerror:
Call error
End Sub

FOR DONOR DETAILS:-


Private Sub command2_Click()
Form6.Hide
Form2.Show
End Sub

FOR BACK:-
Private Sub Command3_Click()
Form8.Show
End Sub

72
Private Sub DataGrid1_DblClick()
Form4.Show
Call datashow
End Sub
Private Sub Form_Load()
Call datashow
End Sub
Private Sub error()
If Err.Number <> 0 Then
MsgBox ("Error: " & Err.Description)
Exit Sub
End If
End Sub
Sub datashow()
On Error GoTo myerror:
Set con = CreateObject("Adodb.connection")
con.Provider = "Microsoft.jet.oledb.4.0"
con.Open App.Path & "\db1.mdb"
'Blood Group setting
Combo1.AddItem "A+"
Combo1.AddItem "A-"
Combo1.AddItem "B+"
Combo1.AddItem "B-"
Combo1.AddItem "O+"
Combo1.AddItem "O-"
Combo1.AddItem "AB+"
Combo1.AddItem "AB-"
Dim strsql As String

73
strsql = "SELECT registration.[Donor ID], registration.Name,
registration.[Phone no],registration.[E-mail
ID],registration.Address,registration.Occupation,registration.[Blood
Group],registration.[Enrollment no/Employee
ID],registration.Department,registration.Faculty,registration.Hall
FROM registration "
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open strsql, con, adOpenForwardOnly, adLockOptimistic
Set DataGrid1.DataSource = rs
DataGrid1.Columns(0).Caption = "D.ID"
DataGrid1.Columns(0).Width = 500
DataGrid1.Columns(1).Width = 700
DataGrid1.Columns(2).Width = 1500
DataGrid1.Columns(3).Width = 2500
DataGrid1.Columns(4).Width = 2500
DataGrid1.Columns(5).Width = 500
DataGrid1.Columns(6).Width = 900
DataGrid1.Columns(7).Width = 2200
DataGrid1.Columns(8).Width = 2200
DataGrid1.Columns(9).Width = 1500
DataGrid1.Columns(10).Width = 900
DataGrid1.Refresh
'rs.Close
selec = 0
myerror:
Call error
End Sub

74
Private Sub Form_Unload(Cancel As Integer)
con.Close
End Sub

75
7.) CONCLUSION

76
Conclusion:
Overall conclusion is that the efficiency and quality are bet served by

the project. by going proper software development phase step by step

through the each phases. Proper testing of the project, its modularity &

simplicity increases its productivity of the project in many ways. And

its visual environment plays the major role in this.

This project has been developed to enable users to manage their daily

work efficiency.

77
78
8.) FUTURE SCOPE

FUTURE SCOPE:

Suppose in the future activities or the method associated with the

Blood Donation System. System is changed or they want some more

activities to be automated, then is such cases this project can be easily

to handle and anyone can operate it. It will not only reduce the cost of

79
maintenance of records but it will be also. Improve the efficiency of

work.

80
9.) BIBLIOGRAPHY:

81
BIBLIOGRAPHY:

• Mastering Visual Basic 6.0 BY Evangelos Petroutsos

• Visual Basic 6.0 programming BY Steven Holzner

• Microsoft Access BY Harkins, ETAL

• Software Engineering BY Pankaj Jalote

• Analysis and Design of Information BY E.M Awad

• www.bloodbank.com

82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154

You might also like