Date post: | 22-Nov-2014 |
Category: |
Documents |
Upload: | carlson-govedi |
View: | 123 times |
Download: | 5 times |
THE CAMBRIDGE ASSOCIATION OF MANAGERSADVANCED DIPLOMA IN COMPUTING
E-VOTING SYSTEM FOR THE REPUBLIC OF KENYA
Done by: Carlson Govedi Saisi
Candidate Number: W-135-10-049
Purpose: Fulfillment of CAM Advanced Diploma in Computing
Dated: October 2010
Presented to: Cambridge Association of Managers, InternationalExaminations, Cambridge, UK.
ii
ACKNOWLEDGEMENT
First I would like to express my deepest appreciation to my supervisor Mr. Clement
Oganga for his guidance during my project work and Digital Advisory Learning Center
(DALC) for providing me with the necessary learning materials and the environment for
learning that has build me with knowledge and ideas to write this project work.
I would also like to thank to all my friends especially Flavin Dona, George Omondi, Tony
Anyama and Solomon Omondi for their sharing of knowledge, endless kindness, advice
and support given to me during the course of the study.
Finally my greatest appreciation and love goes to my family and for sure this would not
have happened without your unconditional love and care.
iii
TABLE OF CONTENTS
DECLARATION-----------------------------------------------------------------------ii
ACKNOWLEDGEMENT-----------------------------------------------------------iii
EXECUTIVE SUMMARY----------------------------------------------------------iv
Table of Contents----------------------------------------------------------------------vi
CHAPTER 1
1.0 Background of study ----------------------------------------------------------- 1
1.1 Background-----------------------------------------------------------------------1
1.2 Problem Discussion------------------------------------------------------------- 1
1.3 Research Questions------------------------------------------------------------- 3
1.4 Qualification of the researcher-------------------------------------------------5
CHAPTER 2
2.0 Literature Review -------------------------------------------------------------- 6
2.1 Democracy ---------------------------------------------------------------------- 6
2.1.1 A view in Elections in Kenya ---------------------------------------------- 8
2.2 E-Democracy------------------------------------------------------------------11
2.3 E-Voting System Definition--------------------------------------------------13
2.4 Basic Principles of E-voting ------------------------------------------------ 13
2.5 Issues in E-voting------------------------------------------------------------- 13
2.5.1 Why is e-voting a difficult problem-------------------------------------- 13
2.5.2 E-voting is Black box system---------------------------------------------- 15
2.6 Common Forms of E-voting------------------------------------------------- 16
2.7 Applications for E-voting ---------------------------------------------------- 17
2.7.1 UK E-voting, past and present-------------------------------------------- 17
2.7.2 E-voting Application in Malaysia University--------------------------- 18
2.8 Program Language-------------------------------------------------------------19
2.8.1 Visual Basic 6 Overview--------------------------------------------------- 19
2.3.1 Summary--------------------------------------------------------------------- 20
iv
CHAPTER 3
3.0 Methodology------------------------------------------------------------------- 22
3.1 Research purpose-------------------------------------------------------------- 22
3.2 Research approach------------------------------------------------------------ 22
3.3 Research strategy --------------------------------------------------------------24
3.4 Data collection----------------------------------------------------------------- 24
3.5 Data Analysis------------------------------------------------------------------ 25
3.6 Validity and Reliability-------------------------------------------------------25
3.6.1 Validity----------------------------------------------------------------------- 25
3.6.2 Reliability-------------------------------------------------------------------- 26
CHAPTER 4
4.0 Algorithm and Logic Design------------------------------------------------- 27
4.1 Algorithms--------------------------------------------------------------------- 27
4.2 Electronic Voting System---------------------------------------------------- 28
4.3 Flowchart----------------------------------------------------------------------- 33
4.4 Source Code-------------------------------------------------------------------- 38
4.5 Physical Design---------------------------------------------------------------- 76
CHAPTR 5
5.0 Implementation---------------------------------------------------------------- 77
5.1 System Development----------------------------------------------------------77
5.2 How to run the program-------------------------------------------------------84
5.3 Summary------------------------------------------------------------------------85
CHAPTR 6
6.0 Conclusion--------------------------------------------------------------------- 86
6.1 Finding---------------------------------------------------------------------------86
6.2 Problems and Limitation -----------------------------------------------------86
6.3 Future Work--------------------------------------------------------------------86
v
6.4 Summary------------------------------------------------------------------------87
References-------------------------------------------------------------------------- 88
Appendix ---------------------------------------------------------------------------90
List of Figures
Fig1.Main Module---------------------------------------------------------------------32
Fig2. Add New Candidate/Voter-----------------------------------------------------33
Fig3. Edit Candidate/Voter-----------------------------------------------------------34
Fig4. Delete Record--------------------------------------------------------------------35
Fig5. Casting Vote---------------------------------------------------------------------36
Fig6. View Results---------------------------------------------------------------------37
Fig7. Log-In-----------------------------------------------------------------------------77
Fig8. Voting Process-------------------------------------------------------------------78
Fig9. Administrator Login------------------------------------------------------------79
Fig10. Administrator User Interface-------------------------------------------------80
Fig11. Add New Candidate-----------------------------------------------------------81
Fig12. Add New Voter/Mwananchi-------------------------------------------------82
Fig13. View Results User Interface-------------------------------------------------83
Fig14. List of voters who did and who did not participate-----------------------84
vi
CHAPTER 1
1.0 Background of Study
This introductory chapter introduces the problem area, the research problem for this
project as well as qualification of the researcher conducting the study.
1.1 Background
Voting in Kenya is the central element of a democracy. Election gives the citizens of
our country the ability to voice their opinions, choose representative and ensure that the
Government remains in the hands of the people. Kenya has faced issues of having real
democracy in power and the basic reason why it has never been able to govern by
proper leadership was insecurity of the people and distrust on the elections, elected
bodies and the democratic environment where people can sell votes and people can buy
votes without any problem.
Digging deep into problem Media Houses like KTN, NTV see the root cause is the ill
mannered activities people do in the elections. As the whole system is manual so they
buy votes and/or shake hands with people working at the voting stations. And the
people in command would fill their pockets and make the whole system unfair.
Therefore Kenya is in need of such a system where people can vote without any
problem and feel secure through some automated system which cannot be forged or
cheated by any one. Here we will try to find out what can be suggested to get fair
results and also make it convenient for voter to vote.
1.2 Problem Discussion
Although voting systems and protocols have improved since their inception, more must
be done to improve their accuracy, reliability, efficiency and security as well as
accessibility and trustworthiness. However just because a government or organization
allows voting makes it a democracy. Voting can be useless if the election outcome does
not accurately represent the combined desires of the voters. What properties must a
voting scheme possess to be considered useful? At the very least, it must allow each
voter to have his opinion counted in the election outcome. Ideally the election outcome
should represent the solution most favorable to the majority.
Paper ballots are subjects to loss and many be corrupted in various ways including
accidental/malicious over voting. Additionally, paper ballots must be securely
transported and counted, activities which tend to make the election process slow, labor
intensive and costly. All paper ballot schemes faces administrative nightmare in order
to get the right ballots to the right locations. Further, the paper ballots required by these
schemes are expensive to print, secure and distribute correctly. Full paper ballot face
the additional task of securing the ballots after they have been marked and before they
can be counted, ballot box opening and ballot counting must be carefully monitored.
We believe that all of this cost significantly more time and money than would be the
case with electronic voting system. Further the mundane, repetitive task of hand
counting is relatively slowed cumbersome. Labor-intensive, inefficient and error-prone.
Hand counting the millions of ballots generated in a Kenya Presidential election would
be quite infeasible and thus to go completely back to full paper ballot system are
unreasonable in practice.
There is also the issue of appointment of polling staff. Polling staff can help in
corruption during the polling; increasing number of polling stations raises the number
of staff required. Polling staff who are appointed away from the area where they belong
to, thus many of the people could not cast their vote. And not only polling staff are
denied a chance to cast their vote also some citizens work a distance from the area
where they are registered as voters so come election day some are not able to go to
their registered area to vote.
A huge number of ballot papers are printed and distributed of polling stations and this
cost millions, not acceptable for a developing country like Kenya. Many of the votes
are not counted due to slight mistake by the voter e.g. voters left thumb impression is
between two check boxes etc. Presiding Officers count ballot papers, but human-
counting is usually sluggish and has chances of error as well as, which means ultimate
disaster ahead in the process of democracy.
2
Breaking down the problem more deeply paper voting in Kenya is not accessible to
many voters with special needs, for example: One voter/several are away from their
voting station during election period and can not make in time, thus they cannot vote
from where they are. Because of these and other user interface problems voters are
unable to vote and millions of other persons with less sever impairment find voting
extremely difficult. E-voting is being proposed to address these issues. Hereby; I will
try to encounter these issues and suggest some better alternatives or solutions to stop
these kinds of illegal activities.
1.3 Research Question
For our research work we formulated a research question as follows:
Based on the effectiveness of currently employed variant of e-voting what factors can
make e-voting success in Kenya?
Definitions of word from the research question:
Effectiveness
“Ability to achieve stated goals/objectives, judged in terms of both output and impact.”
In the case electoral system, effectiveness means “The power of a ballot to influence
the election outcome. In our research we focus on replacing of paper-based voting with
electronic one. So ballots will be replaced by electronic votes.
In our research we are going to measure effectiveness with these criteria’s:
1. Cost
Resource
Investment
2. Time
Casting a Vote
Calculation of the results
3. Result
Correct results
Avoiding human errors
4. Transparency
3
Elections are not rigged.
We divide users of the e-voting system in three groups
1. Voters (Mwananchi)
2. Government (Official)
3. Electoral Candidate (Candidate)
For voters these criteria of effective e-voting system are important:
Time
Transparency
Correct Result
Easy-to-use system
For the government important criteria of effective e-voting are:
Cost
Time
Results
For electoral candidate the most important criteria of effective e-voting are:
Time
Correct result
Transparency
Success
“An event that accomplishes its intended purpose”. In case of e-voting success means
being effective system to replace paper-based voting. In our research the intend purpose
of the e-voting system is to satisfy the needs of the following group of users:
Voter
Official
Candidate
From voters perspective e-voting system will be successful if:
It will be easy-to-use system
One will be able to make a fast voting and be able to vote anywhere also get results
faster than it was provided with paper-based system(time factor)
It will not be a complicated process(transparency factor)
4
System reliability, security and objectivity will provide correct voting results(results
factor)
From official/government perspective e-voting system will be successful if:
Price of the system will be affordable and not much sensitive for the budget(price
factor)
It will be reusable with minimum costs involved and would be able to work in the
long-term perspective.
It will provide results fast(time factor)
Fewer complaints from voters and candidates about the procedure and results of the
election (transparency and results factor)
It will eliminate human factor errors.
From the candidate perspective e-voting system will be successful if:
They will get faster results of voting (time factor)
They will be sure that results are correct ( results factor)
They will be able to monitor electoral process at any time (transparency factor)
1.4 Qualification of the researcher
“For the last four years I have being studying computers, the first two years while I was
in high school and for the last one year I have done Standard Diploma in Computing
and these year I have been doing an Advanced Diploma in Computing at DALC,
Kisumu. Now I have totally devoted myself to computers and now I am trying more
system way of thinking and understanding problems
CHAPTER 2
5
2. Literature Review
2.1. Democracy
Democracy is a journey of reflections and making decisions or it can be defined as way
of governing based on peoples consent. Since representative democracy gives huge
powers to the elected leaders, it is important that any electoral process produces the
right leadership. It indicates a form of government where all the states decisions are
exercised directly/indirectly by a majority of its citizenry through a fair elective
process. When these factors are met a government can be classified as such. In a phrase
democracy is a government “of the people, by the people and for the people.” It is
based on the understanding that power belongs to the people and thus government is
answerable to them. People have the power to decide freely how they want to be
governed and by whom. Democracy requires tolerance and consensus between people.
The wishes of all are taken into consideration. Whereas the majority will have their
way, the wishes and needs of minorities and disadvantage groups must also be
respected.
What are the pillars of a democracy?
For a genuine democracy to grow, a society must practice the following for all
citizens:-
1) Justice
2) Fairness
3) Equality
4) Respect for rights and freedoms
The constitution provides the following key freedoms:-
i) Freedom of expression
ii) Freedom of press
iii) Freedom of association
iv) Freedom of acquire(though lawful means), own and sell property
Kenya which has a large area and population uses indirect democracy. This is form of
democracy where people do not directly govern themselves but elect or vote for person
to represent them in the local government, Parliament or as their president.
6
Principles of a democracy
The understanding and practice of democracy differs from one country to another.
There are however basic principles that constitute a democratic government. The
following are some of the principles supported by people in most democracies:-
i) Citizen Participation: This involves participating in political parties activities
including attending rallies and other consultative meetings, being members of private
voluntary organizations, paying taxes and even protesting lawfully to demonstrate in
disagreement with the government of the day on certain issues.
ii) Human Rights and Freedoms of the Individual: Democracy emphasizes the value of
every human being. Examples of human rights include the right to life, to personal
liberty, protection from slavery and forced labor, protection from deprivation of
property, freedom of conscience, of expression, of movement, protection from
discrimination on grounds of race, sex etc.
iii) Political Tolerance: The rights of the majority and minorities must be protected.
Individuals must learn to be tolerant of one another’s point of view and to respect other
people’s freedoms and rights.
iv) Accountability: Elected and appointed officials have to be accountable to the
people.
v) Transparency: The Press and the public should be able to get information about
decision affecting them by those they have elected and other public officers serving on
their behalf.
vi) Multi-party Political System: More than one party must participate and compete
peacefully in elections and play a role or contribute to the process of governance.
vii)Regular Free and Fair Elections: Citizens express their will though elected
representatives. In a democracy, elections are held regularly. It is important for
elections to be free, fair and transparent. This requires the removal and intolerance of
obstacles such as excessive government control, intimidation, violence or corruption.
viii) Acceptance of Election Results: In democratic elections, there are winners and
losers.
ix) Equality before the Law: All individuals are valued equally and should not be
discriminated on the grounds of race, religion, ethnic origin or sex.
7
x) Control of Abuse of Power: There should be control of the abuse of power. Some
examples of abuse of power include:-
a.) Corruption
b.) Discriminatory use of public resources or facilities by
government, institutions or individuals to campaign.
In the following discussion I am going to narrow down my scope to election process
selection of the governing people in a democratic country Kenya
2.1.1 A View on Elections in Kenya
If we take a look on the history of Kenya, we come to know that it is a democratic
country since independence, the country is divided into eight (8) provinces also as a
result of public elections is one of them. So Kenya was made on the basis of democracy
and is named as The Republic of Kenya. Till date, as to the law, the government of
Kenya is supposed to be elected by citizens by means of transparent elections.
Currently the Republic of Kenya is almost completing its 5 years democratic period in
the Parliament and now we are going to have elections in 2012. So working on this
topic helped me understand the flaws in the system and have understanding of
Kenyan’s political situation. The following are a few statistics given to have a quick
review of the current system to elect government people in Kenya.
Government (Semi-presidential system)
Due to unavoidable circumstance the election that was held in 2007 brought us a semi-
presidential system. The semi-presidential system is a system of government in which a
Prime minister and a President are both active participants in the day-to-day
functioning of the administration of a country.
Government Representatives.
The Parliament of Kenya consists of the National Assembly, and the Senate. The
National Assembly consists of 290 members, while the Senate consists of 47 members
each elected by the registered voters. They are elected for a term of 5 years.
8
Electoral Commission
It’s the duty of the Electoral Commission to organize and conduct the election and to
make such arrangements as necessary to ensure that the election is conducted honestly,
justly, fairly and in accordance with law and that corrupt practices are against
The electoral system shall comply with the following principles:
Freedom of citizens to exercise their political rights under Article 38;
Not More than two third of the members of elective public bodies shall be of the
same gender
Fair representation of persons with disabilities
Universal suffrage based on the aspiration for fair representation and equality of
vote; and
Free and fair elections which are:- By secret ballot, free from violence, intimidation,
improper influence or corruption conducted by and independent body, transparent and
administered in an impartial, neutral, efficient, accurate and accountable manner
Membership of the National Assembly
Members of the National Assembly are elected by the registered voters of single
member constituencies. A candidate, who obtains the highest number of votes in a
constituency, is declared elected as a member of National Assembly. It consists of 290
members.
Membership of the Senate
The senate consist of 47 members each elected by the registered voters of the counties,
each constitution as a single member constituency.
Election of the President
The President shall be elected by registered voters in National election conducted in
accordance with the Constitution and any Act of Parliament regulating presidential
elections. A person who is a citizen by birth is qualified to stand for election as a
member of Parliament is nominated by a political party or is an independent candidate
9
and is nominated by not fewer than two thousand voters from each of a majority of the
counties can contest the Presidential election
The President is elected for a term of 5years. It is the duty of the Independent Electoral
and Boundaries Commission to conduct election to the office of the President on the
same day as general elections of Members of Parliament being the second Tuesday in
August, in every fifth year. The candidate shall be declared elected as President if the
candidate receives more than half of the entire vote cast in the election.
Qualifications for Election as Member of Parliament
A person is eligible for election as a member of Parliament if the person is a registered
as a voter, satisfies any educational moral and ethical requirements prescribed by the
Constitution or by an Act of Parliament and is nominated by a political party, or is an
independent candidate who is supported: (i) In the case of election to the National
Assembly, by at least one thousand registered voters in the Constituency or (ii) In the
case of election to the Senate, by at least two thousand registered voters in the county.
Eligibility of being a Voter
A person qualifies for registration as a voter at elections or referenda if the person is an
adult citizen (18yrs and above), is not declared to be of unsound mind and has not been
convicted of an election offence during the preceding five years. Administrative
arrangements for the registration of voters and the conduct of elections shall be
designed to facilitate and shall not deny an eligible citizen the right to vote. You must
have a national ID or a valid Kenyan passport, must have lived in Kenya for one year
before registering/at least.
2.2 E-Democracy
E-democracy, a portmanteau of electronic and democracy, comprises the use of
electronic communication technology such as Internet in enhancing democratic
processes within a democratic republic/representative democracy.
10
Typically, the kinds of enhancements sought by proponents of e-democracy are framed
in terms of making processes more accessible; making citizen participation in public
policy decision, making more expensive and direct so as to enable broader influence in
policy outcome as more individuals involved could yield smarter policies, increasing
transparency and accountability and keeping the government closer to the consent of
the governed, increasing its political legitimacy. E-democracy includes within its scope
electronic voting, but has much wider span that this single aspect of the democratic
process.
E-democracy is large field of study and there is no all-encompassing definition.
Essentially, e-democracy relates to the online activities of governments, elected
representatives, political parties and citizen groups. The websites of these organizations
have a variety of functions, which include political, or current affairs discussion, online
consultation between representatives and their constituency, or there can be a free and
non-partisan forum of discussions by citizens.
Importance of this Issue
E-democracy is relatively new concept, which has surfaced out the popularity of the
internet and the need to re-invigorate interest in the democratic process. Citizens are
more willing to use website to support their candidate and campaign drives. Time
saving, efficiency of procedure and reliability are worthwhile.
Below are some types of e-democracy:
1. Online consultations and political websites online: Online consultation/e-consultation
refers to an exchange between government and citizens using the Internet. They are one
form of online deliberation. Further, e-consultation consist in using the Internet to ask a
group of people their opinion on one o more specific topics, allowing for trade-offs
between participants. Generally, an agency consults a group of people to get their
thoughts on an issue when a project/or a policy is being developed/implemented e.g. to
identify/access options or to evaluate ongoing activities. This enables government to
draft more citizen-centered policy.
11
As the Internet gain popularity with the public for voicing opinion, citizen participation
in policy development through cyberspace is changing the face of democracy. The rise
of the Internet has given a way to buzzwords such as e-democracy, referring to citizen
participating in politics, government issues and policy development through electronic
technology and the Internet and e-government, pertaining to providing citizens with
government information and services online. Online consultation is an extension of
these concepts. Through online engagement, government is enabled to hold interactive
dialogues with the public as they have amore direct route to citizen opinion via the
Internet.
Online consultations are probably the first step taken by many governments in creating
and e-democracy. Nearly all government has made legistalation case law and other
information online. E-democracy communities have been set up, which encourage
participation in the political process via the Internet. E-consultations do not challenge
traditional notions of democracy in any significant way. Therefore e-consultations are
more likely to be adopted than the more radical direct voting form of e-democracy.
2. E-Voting: E-voting combines technology with the democratic process, in order to
make voting more efficient and convenient for voters. E-voting allows voters to either
vote by a computer at the polling station, from a website or from your mobile phone.
a) E-voting at the polling booth – This form of e-voting is virtually the same as regular
voting, but replaces the ballot paper with a balloting machine/computer. These
machines are only connected to a private network and server while voting is going on
or after the voting is done.
b) E-voting Online – The most advanced form of e-democracy would be voting online,
which would allow voters to cast their votes from anywhere there is internet access.
The Internet is viewed as a platform and delivery medium for tools that help to
eliminate some of the distance constraints in direct democracy. Technical media for e-
democracy can be expected to extend the mobile technologies such as phones.
12
2.3 E-Voting System Definition
“Definition The e-voting is the system to enhance efficiency in the voting process by
automating the current manual voting process using electronic devices. Introducing the
e-voting system will enhance efficiency in voting by reducing time required for ballot
counting and counting errors.”
Functions
Analyze ballot counting results more promptly and accurately through electronic
ballot counting.
Provide a user interface easy to use and access to register to voters list.
Expected Effects
A higher turnout of voters is expected.
Voting time and cost will be reduced through the use of an electronic device. High
accuracy and promptitude of voting result.
2.4 Basic Principles of E-Voting
The main principles of e-voting is that it must be similar to regular voting as possible,
compliant with election legislation and principles and be at least as secure as regular
voting. Therefore e-voting must be uniform and secret, only eligible persons must be
allowed to e-vote, a voter must not be able to prove in favor of who he/she voted. In
addition to this the collecting of votes must be secure, reliable and accountable.
2.5 Issues in E-Voting
2.5.1 Why is e-voting a difficult problem?
First, let’s consider the international standards an election has to meet to be considered
free and fair:
Individuals have to be accurately identified as eligible voters who have not already
voted.
Voters are only allowed one anonymous ballot each, which they can mark in
privacy.
13
The ballot box is secure, observed and during the election, only able to have votes
added to it by voters. Votes cannot be removed.
When the election ends the ballot box is opened and counted in the presence of
observers from all competing parties. The counting process cannot reveal how
individual voters cast their ballots.
If results are in doubt the ballots can be checked and counted again by different
people
We can formulate three basic steps for a computerized voting system: check that a user
is entitled to vote and hasn’t already; show the user the ballot and record their vote; and
finally, count the votes. In an election we cannot associate your identity with your vote
without breaching your privacy, yet somehow we need to be certain that you actually
are entitled to vote.
To prevent ballot stuffing, we must mark your vote so that we can be sure it came from
a real voter, yet we cannot trace this vote to you personally. It turns out that this is an
extremely difficult cryptographic problem that still challenges top scientists and there
simply are no solutions which are practical and which fulfill all necessary criteria. In
the meantime e-voting suppliers are selling system they believe are ‘good enough’, but
which make compromises. The problems with e-voting arise not only because these
compromises are made, but also because of the difficulties of building any large-scale
computer system. All election counts have same problems due to human error.
However these errors are random, as likely to affect one candidate as another, so that
overall the result is fair. If errors become systematic, such as if an e-voting system
doesn’t register any votes for one or counts backwards for one candidate whilst
counting forward for another, then the errors aren’t evenly distributed. This means that
one candidate is more likely to be affected than others and so the election result isn’t a
fair representation of voter’s intentions.
These types of errors can have serious implications: small vote manipulation of less
than 1% in key marginal seats can swing the results of elections in first-past-the-post
systems such as that used in the UK. And, as will be shown below, countries with
14
voting system less sensitive to fraud than first part-the-post are already withdrawing e-
voting system.
2.5.2 E-Voting is a Black box system
Voting technology is what is known as a ‘black box’: voters, candidates and officials
cannot see the inner working of the machines. Only a small group of technology experts
has any hope of understanding how the election is being conducted and counted.
Because the votes are invisible, made up of ones and zeros, it is extremely difficult
even for experts to be certain that what vendor claim is happening really is happening.
Manipulating bits in a computer is much easier than copying paper ballots, so there is
potential for undetectable vote manipulation on scale never seen before: a hacker could
hide a tiny piece of code in the voting software that could invisibly, but significantly,
modify an election’s results. But putting aside undetectable hackers, vote stealing and
other manipulations, we must also remember that these systems are built by ordinary,
fallible people. Like all computer e-voting system go wrong and usually do so on
Election Day because this is the only time they are used. And the problems that come to
light are not trivial. There have been cases where the system failed completely,
depriving people of their right to vote.
Problems are often not discovered until the election is over, when it is impossible to say
how the votes should have been cast. Because the votes are stored as bits, there is
nothing for election officials to study when problems occur, as there is with paper
ballots. There is nothing to audit except some memory cards, which cannot shed any
light upon what happened but can only provide a final tally. There is no way for the
voter, candidates/officials to know whether the voter’s intent was accurately stored and
the correctly counted by the e-voting system. Everything happens inside the black box.
With paper ballot the voter can see their mark and has immediate feedback. That mark
is stored, unchangeable, in the ballot box until it is time to be counted. If a recount is
required, that ballot can be examined a second time. It would be trivial for an e-voting
to report it has stored a vote for Ms X when in fact Mr. Y gains one vote in the
memory. Under these circumstances a recount is no help, as the computer adds the
same numbers up again and will arrive at the same result each time.
15
2.6 Common Forms of E-Voting
Kiosk
Kiosk e-voting consists of dedicated machines being used in the polling station or
elsewhere, such as shopping mall, to let electors cast their votes. Votes are cast using
buttons/a touch screen and are stored in an electronic memory. If used in a polling
station, kiosk systems have the advantage of being supervised. But unless a paper ballot
is printed at the time of voting and checked by the voter, manual recounts are not
possible. If there are any technical problems/attempts at fraud, polling station staff lack
the skills the resolve matters; they are dependent on support from the e-voting supplier.
This support is often sun-contracted, bur regardless it is inevitable that voters will be
forced to wait until support staffs can attend to the polling station. In America, this has
resulted in a need for court injunctions to decide whether the polling station can stay
open long enough to let waiting voters exercises their right to vote. Kiosk Machine is
costly, particularly in light of the fact that they can only be used for elections. Whilst
kiosk machines can provide audio and other input/output features to help voters with
disabilities vote alone, they are only shifting their trust from a helper in the polling
station to a system they cannot be sure is voting as they desire
Remote (Internet)
Voters sit at home/ in a library and use a computer, digital television or mobile phone to
mark their ballot. Elections held using remote voting can be contentious because it is
difficult to verify that the voter is who they claim to be. Both anonymity and privacy
are compromised because others can watch the elector vote. This opens the door to
voter coercion and vote buying. There are technical problems too. The system is
vulnerable to attacks both on the central e-voting server and each computer used to
vote. These attacks may disrupt the process of voting or bring the results into question.
Phone
Votes are cast either through a touch-tone system (similar to that used for television
votes)/through SMS text messages on mobile phones authentication is achieved through
the use of PIN and access codes that are mailed to voters ahead of the ballot. While
16
proven in entertainment settings where there are no requirements for authentication
such systems are not suitable for democratic elections. Phone voting depends on highly
centralized, private infrastructures which, in the case of SMS, are unreliable and
insecure (SMS messages are sent ‘in the clear’ and so could be intercepted). Thus
privacy is virtually impossible to maintain and security is based more on commercial
confidentiality and control of the connections than any explicitly protocol (such as SSL
on the web). Indeed TV Production companies encourage multiple voting as a way to
increase their revenue from each vote cast. For the very enthusiastic fan, software is
available on the internet which automates dialing, allowing a single individual to vote
hundreds of times.
E-Counting
Specially designed ballots are marked by voters in such a way that an optical counting
machine, i.e. a computer, can read them. The advantages of the paper ballot system are
retained, but counts are quicker and if problems arise recounts of the ballots can still be
done by hand. However, computer-readable ballot papers can be confusing for some
voters, resulting in errors and lost votes. E-counting systems are as vulnerable to fraud
and error as other forms of e-voting technology, and unless the ballot papers are
regularly audited and counted, those incorrect/fraudulent results can escape detection.
2.7 Applications for E-Voting
2.7.1 UK E-Voting, past and present
May 2003 saw the largest electoral pilots ever, covering 14% of the English electorate,
funded with £18.5m from central government, in addition to the usual local government
electoral budgets. Mistakes were made, many of which were clearly identified in the
Electoral Commission’s evaluation reports.
In particular, the selection and management of e-voting vendors was heavily criticized.
Competing vendors were forced to work together without prior notice or contracts.
Vendors took control of running elections from Returning officers. There were no clear
structures/lines of responsibilities in which vendors were impossible to scrutinize as
nobody except the vendors knew what was supposed to be happening. Extremely tight
17
implementation timescales imposed by the Government were roundly criticized by the
Electoral Commission and vendors.
The lack of time prevented proper testing and evaluation of the systems before
elections. The little testing that was done was felt not to have been sufficiently
independent of the suppliers. The Government’s extraordinary view was that short
timescales is extremely tight, yet by January 2007 the Government was already a month
behind in a timetable that only allowed two months for implementation and testing. In
2003 the lack of time prevented proper security testing and analysis, complete risk
assessment and usability testing. Are these absolutely necessary steps to be skipped
again due to lack of time? None of the Department for Constitutional Affairs, local
government or the Electoral Commission has the technical expertise to evaluate and
manage e-voting vendors properly.
The result is that vendors have to be trusted to run elections in secure, reliable and
private manner without proper external, independent testing and evaluation. These
amounts to the effective privatization of our election systems, as for-profit corporations,
usually foreign-owned, are paid to completely administer our election from start to end.
We do not believe this is healthy for democracy. It is vital that elections are publicly-
run and scrutinized. Undoubtedly e-voting system brings new risks, challenges and
costs to our electoral process. So what are the benefits? Initially, claims were made that
e-voting could save money spent in the electoral process. This was quickly discarded in
favor of arguing that e-voting could boost turnout, particularly.
2.7.2 E-Voting Application in Malaysia University
At the International Islamic University (IIU), e-voting proceeded smoothly with 68% of
the 13,219 students eligible to vote having cast their ballots as at 2.45pm. The 10
polling stations at IIU opened a few minutes after 9am and closed at 4.45pm. Results
were announced by 6.30pm, with UIA rector Prof. Datuk, Dr. Syed Arabi, I did release
a statement at around 7pm (Gilmore, 2006).
18
Students were generally satisfied with the electronic voting system, with no reported
disruptions at IIU (Gilmore, 2006). It was a different story at University Putra Malaysia
(UPM), which saw the electronic-voting system experiencing an hour-long breakdown
from 9.45am to about 11am.
The implementation of e-voting is the latest threat to the rights of students via what was
promised as secret balloting. The validity of this electoral process is suspect because it
lacked transparency. The lack of transparency, lack of confidence in its accuracy and
trustworthiness, the high risks, the lack of scrutiny and violation of the secrecy of the
ballot are the main reasons for the doubts among students over the electoral system at
University Putra Malaysia.
2.8 Program Language
2.8.1 Visual Basic 6 Overview
Visual Basic is the third-generation event-driven programming language and integrated
development environment (IDE) from Microsoft for its COM programming model.
Visual Basic is also considered a relatively easy to learn and use programming
language, because of its graphical development features and BASIC heritage. 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 VBScript is syntactically similar to
Visual Basic, but perform differently.
A programmer can put together an application using the components provided with VB
itself. Programs written in VB can also use the Windows API, but doing so requires
external function declarations. The language not only allows programmers to create
simple Graphical User Interface (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
19
defined for the components, a simple program can be created without the programmer
having to write many lines of code.
Forms are created drag-and-drop techniques. A tool is used to place controls (e.g. text
boxes, command buttons etc) on the form (window). Controls have attributes and event
handles 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/changes in the environment, providing a dynamic
application.
Visual Basic executable (EXE files), ActiveX controls, or DLL files, but is primarily
used to develop Windows application and to interface database system. 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 e.g. 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 perform some action based on which element was selected such as
popularity a related list.
2.9 Summary
Elections allow the populace to choose their representatives and express their
preferences for how they will b governed. Naturally, the integrity of the election system
must be sufficiently robust withstand a variety of fraudulent behaviors and must be
sufficiently transparent and comprehensible that voters and candidates can accept the
results of an election. Unsurprisingly, history is littered with examples of elections
being manipulated in order to influence their outcome.
The main principle of e-voting is that it must be as similar to regular voting as possible,
compliant with election legislation and principles and be at least as secure as regular
voting.
20
Voting technology is what is known as a ‘black box’: voters, candidates and even
officials cannot see the inner the workings of the machines. Only a small group of
technology experts has any hope of understanding how the election is done
Found previous application for the elections electronic, some of these applications
succeeded and others failed, and faced several problems mentioned earlier. But for e-
voting in universities found that it greatly succeeded.
21
CHAPTER 3
3.0 Methodology
The aim of this chapter is to give an introduction about the general research methodology
used in this study together with specific tools used in data collection and analysis. Also
this chapter discusses the methods to evaluate validity and reliability of the research.
3.1 Research purpose
In the information age, it seems that the application of information technology is an in-
dispensable tendency for the evolution of organizations in 21st century, regardless of
public or private organizations. The application of information technology into public
affairs briefly includes the electronic democracy, which is governance-oriented, and e-
government, which is service-oriented. E-Voting being a vital part of the services being
offered by e-Government would lead the application of information technology to
improve the efficiency of public sector obviously and the participation of the citizen
through the electronic forum.
The purpose of this research is to go through the current situation of Kenya’s democracy
and electoral system in context of the view point of people of Kenya. Furthermore, one
purpose to make a research in this area is to get to know the factors affecting the
implementation of electronic voting in Kenya in coming future. It is also important as
Kenya is near to hold its general elections in December 2012.
3.2 Research approach
There are two main research approaches used in scientific work, quantitative and
qualitative. The main difference between these two is that the aim of quantitative
research is to fin explanation to a phenomenon or a situation that can be generalized to
other people and places while in qualitative research the aim is to gain deeper
understanding of a phenomena or a situation.
In our study we will be using both of them. Our aim is to find out the factors affecting the
implementation of electronic voting in Kenya. And finding out what way of electronic
voting in Kenya should adopt in order to have smooth transformation of normal electoral
system to the electronic one. Our work will be divided in 2 parts. First one will be
devoted to analyzing of case-studies of implementation of e-voting in different countries.
22
During this part we will be using qualitative research approach. Second part of our
research will be to find out peoples opinion about the situation with democracy in Kenya
and need for implementing of e-voting.
During this part we will be using quantitative research approach.
We are going to collect data using the literature about the subject, Internet survey to
question people that are using or not using e-government services. This will help us to
form a picture of what kind of people are using the e-government services and what
motivates them to believe or not believe in having electronic voting in Kenya, what is the
level of their satisfaction, how do they evaluate current way of voting system and what
drawbacks and good points they see in old system and electronic system and also what
level of security they think is necessary to be implemented while thinking of e-voting.
There are 2 reasoning in analyzing data that we are going to use in our research:
Deductive and Inductive reasoning.
Deductive reasoning is sometimes called the “top-down” approach. It begins with theory
about the field of interest and narrowing that theory down into hypothesis that can be
later tested. Next observations are collected to address the hypothesis which then leads to
the testing of the hypothesis to confirm the original theories.
Inductive reasoning on the other hand is called the “bottom up” approach that moves
from observations meant for detecting patterns to develop conclusions or theories and
also broader generalizations and theories. This kind of reasoning is open-ended and
exploratory. And it is used in a way that a researcher observes a sample and then draws
conclusions about the population from which the sample is taken.
According to these two definitions we are going to use inductive and deductive reasoning
to analyze the collected date from our surveys and case-studies. Based on the answers
given of the particular users of the e-government services and published materials we
will try to form picture of the present situation. Then based on the people’s opinions we
will come up with ideas about changing the present situation in order to encourage
people to use the e-government services more often.
23
3.3 Research strategy
There are five primary research strategies in the social sciences: experiments, surveys,
archival analysis, histories, and case studies. Each strategy has its own advantages and
disadvantages.
Some scholars use the term survey research to refer to almost any form of descriptive,
quantitative research. We use a more restricted meaning here: Survey research involves
acquiring information about one or more groups of people – perhaps about their
characteristics, opinions, attitudes, or previous experiences – by asking questions and
tabulating their answers.
The ultimate goal is to learn about a large population by surveying a sample of that
population; thus, we might call this approach a descriptive survey or normative survey.
We have chosen survey research and case-studies as our research strategy. We are using
quantitative and qualitative approach for our research, that’s why surveys and case-
studies are the most fast and convenient way to conduct this kind of research. For us also
very important to get people’s attitude to the problem and find causes of their fear about
this new e-voting service.
That’s why we are looking forward to get as much respondents as possible. And using
surveys in this scenario will be most appropriate. Also we want to compare already
existing systems in order to see the results of their implementation and choose most
suitable system for Kenya. So case-studies will help us to achieve this goal.
3.4 Data collection
In our research we are going to use two forms of collecting data: internet survey and
study cases.
As far as topic of our research is related with electronic voting aspects, there are a lot of
publications from different governmental authorities and scholars concerning electronic
systems used in e-voting in particular countries. We find this material very useful,
because it will help us to look on to our main topic from different point of views. To see
what systems are implemented, what problems remained, what suggestions are given.
At the same time we will use our internet survey in order to analyze what people think
24
and consider while seeing the perspectives of implementation of electronic voting. It will
also lead us to believe why and how people think is wise to have this kind of voting and
what justification they look for while trusting the new system to be implemented.
Our survey is open for all the people from Pakistan that are using or may use e-
government services. But due to limited time of research and lack of mail-databases of
actual users, we believe that most of the respondents will be students of different
institutes/universities with different educational and financial backgrounds. This has two
sides, first is that our research will not cover the main part of e-government users (we
believe that our respondents are between 18-50 years old). Second, as far as our target
group may be students, we may consider them being future users of the e-government.
So it’s very important to develop e-government services in order to meet their
requirements. And also young people are more familiar with computers, internet and
security aspects. And they also have fresh and modern view on the problem situation.
3.5 Data analysis
After we finish collecting data from the survey we will conduct and from the case
studies, we are going to represent the results in tabular / graphical form. So it will be
easier for readers to understand them and would be easy for us to analyze them and
present to readers. Also, as far as we are going to have some cross-related question, we
will need to analyze them separately and make some conclusions based on results we
receive from our survey.
After we will finish making statistic analyze of data, we will try to sum up the results and
make some conclusions about what are the prospects of implementation of electronic
voting in Kenya
3.6 Validity and reliability
3.6.1 Validity
When we consider the validity of a research study we need to ask two basic questions.
First, does the study have sufficient controls to ensure that the conclusions we draw are
truly warranted by the data? Second, can we use what we have observed in the research
situation to make generalizations about world beyond that specific situation? The answer
25
to these two questions addresses the issues of internal validity and external validity
respectively.
3.6.2 Reliability
Reliability of a measurement instrument is the extent to which it yields consistent results
when the characteristics being measured has not changed. A researcher can enhance the
reliability of a measurement instrument in several ways. First, the instrument should
always be administered in a consistent fashion: In other words, there should be
standardization in use of the instrument from one situation or person to next. Second, to
the extent that subjective judgments are required, specific criteria should be established
that dictate the kinds of judgments the researcher makes.
And third, any research assistants who are using the instrument should be well trained so
they can obtain similar results.
According to the target group we have chosen and the complexity of the problem we
have to research on, the reliability and validity of the research may vary. But by
narrowing down the target group we try to research we will be able to increase the
reliability of the research.
26
CHAPTER FOUR
4.0 ALGORITHM AND LOGIC DESIGN (FLOWCHART)
4.1 ALGORITHMS
Algorithm consists of the step-by-step procedure in solving a given task. The algorithm is
broken down into modules to allow for a detailed evaluation of the programming
procedures.
Also, in this chapter the graphical representation of the algorithm known as the
FLOWCHART is given. The flowchart is another vital tool in program development
process, which in fact gives a clearer picture and understanding of representation of the
sequence of operations.
Logical Design
Hevner et al. (2004) explained that logical design is the phase where all functional features
that have been chosen for the development of the system are described without regard of
any computer platform. Assuming that the developed system could be implemented on any
hardware/system software, the aim of this phase is actually to make sure that the system
can really function as it should be. This also involved the representation of functional
requirements of the system in the form of notation which in the case of this study, the
Object Oriented approach was adopted by the researcher. The adoption of this approach is
in line with the needs to produce more details design besides the increasingly complex
system requirement. Object oriented offer conceptual structures of the system to assist in
understanding the whole systems’ functions especially during use case diagram to represent
the whole functions available in the e-voting system.
27
4.2 ELECTRONIC VOTING SYSTEM
ALGORITHM FOR MAIN PROGRAM MODULE
Step 1: START
2: Define and Initialize variables
3: Display user Login Screen
4: Open Database
5: Prompt to enter user ID and Password
6: IF password is invalid THEN Step - 4
IF Login Exit THEN Step - 9
7: IF Password = ‘Administrative Password’ THEN GOTO Main Window
IF Password=’Official’s Password’ THEN GOTO Main Window
IF Password = ‘Voter’s Password’ THEN GOTO Voter’s Screen
8: END IF
9: Close Database
10: STOP
ADMINISTRATIVE MODULE
Step 1: Display main Program Window
2: Open Database
3: Display main menu (Option)
4: Make Selection from menu
5: On Selection transfer control to appropriate subroutine
6: Close Database
7: Return
ADDNEW CANDIDATE: SUBROUTINE
Step 1: Display program interface in Input Mode
2: Open Database
28
3: Enter Candidate’s Personal Data
4: Enter Candidate’s Position and Party
5: IF Candidate Record Already exist in Database THEN Step -7
IF Exit Window THEN Step -8
6: Save Record to Database
7: Add another Record (Yes / No)?
8: IF Response = “YES” THEN Step – 3
ELSE Step – 9
9: Close Database
10: Return
ADDNEW OFFICIAL: SUBROUTINE
Step 1: Display program interface in Input Mode
2: Open Database
3: Enter Official’s Personal Data
4: Enter Official’s Position and Party
5: IF Official Record Already exist in Database THEN Step -7
IF Exit Window THEN Step -8
6: Save Record to Database
7: Add another Record (Yes / No)?
8: IF Response = “YES” THEN Step – 3
ELSE Step – 9
9: Close Database
10: Return
ADDNEW VOTER: SUBROUTINE
Step 1: Display program Interface in Input Mode
2: Open Database
3: Enter Voter’s Details
4: IF Voter’s Record Already exists in Database THEN Step – 6
29
IF Exit window THEN Step – 8
5: Save Voter’s Record to Database
6: Add Another Record (Yes/No)?
7: IF Response = “Yes” THEN Step – 3
ELSE Step – 8
8: Close Database
9: Return
EDIT CANDIDATE’S, OFFICIAL’/ VOTER’S RECORD: SUBROUTINE
Step 1: Display program interface in Edit Mode
2: Open Database
3: Prompt to enter Candidate’s / Voter’s ID No:
4: IF ID No: is invalid THEN Step – 3
IF Exit Window THEN Step – 10
5: Display record for Update
6: Make necessary changes
7a: Save record after changes
7b: Update Database
8: Edit another Record (Yes/No)?
9: IF Response = “Yes” THEN Step – 3
ELSE Step - 10
10: Close Database
11: Return
DELETE CANDIDATE’S, OFFICIAL’ / VOTER’S RECORD: SUBROUTINE
Step 1: Display program interface in output mode
2: Open Database
3: Prompt to enter Candidate’s / Voter’s ID No:
4: IF ID No: is Invalid THEN Step – 3
IF Exit window THEN Step – 11
30
5: Display record to for deletion
6: Display confirmation message
7: IF Confirmation = “Yes” THEN Step – 8
ELSE Step – 3
8a: Delete displayed record from Database
8b: Update Database
9: Delete another record (Yes/No)?
10: IF Response = “Yes” THEN Step – 3
ELSE Step – 11
11: Close Database
12: Return.
VOTER WINDOW (CASTING VOTE): SUBROUTINE
Step 1: Display Interface in Input/Output Mode
2: Open Database
3: Select candidate details from a List Box
4: IF Candidate’s Details is invalid THEN Step – 3
IF Exit window THEN Step – 9
5: Cast your vote
6: Update Database
7: Close Database Connection
8: Return
VIEW RESULTS: SUBROUTINE
Step 1: Display Interface in Output mode
2: Display results in a list view
3: Open Database
4: Display results for all position
5: Close Database
6: Return
31
4.3 FLOWCHART
MAIN MODULE
Enter UserID and Password
Enter UserID and Password
START
Define and Initialize variables
Display user Login Screen
Open Database
No Continuel? Yes
IS userID and Password Valid?
YES
NO
A
Display Main Window: Display Main Menu ADDNEW RECORDEDIT RECORDDELETE RECORDCAST YOUR VOTEVIEW RESULT(REPORT)
A
1
2
3
4
5
RETURN
ADDNEW RECORD
EDIT RECORD
DELETE RECORD
CAST YOUR VOTE
VIEW RESULT (REPORT)
Make Selection Based On Main Menu
ON Selection
Fig 1.0 Main Module
32
ADDNEW CANDIDATE’S / VOTER’S RECORD
ADDNEW RECORD
Display form in Input Mode
Open Database
Continue?NO
YES
Enter candidates / voters Data
Select position contesting for
Is Record Already YES In Database?
NO
Update Database
Save Record to Database
Add another YES Record?
NO
Close Database
RETURN
Fig .2 Add new candidate/voter
33
EDIT CANDIDATE’S / VOTER’S RECORD: SUBROUTINE
EDIT RECORD
Display Program Interface in Edit Mode
Open Database
Continue?NO
YES
Enter Record IDnumber to Edit
IS Record IDNumber Valid?
YES
NO
Display Record for Editting
Make necessary changes
Save changes to Database
Update Database
EditAnother Record?
NO
YES
Close Database
RETURN
Fig.3 Edit Candidate/Voter
34
DELETE RECORD: SUBROUTINE:
DELETE RECORD
Display Program interface in Output mode
Open Database
Continue?
YES
NO
Enter Record IDNumber to Delete
IS Record IDnumber Valid?
NO
YES
Display record on form
Delete record from Database
Delete Displayed Record?
NO
YES
Update Database
Close Database
Delete Another record?
NO
YES
RETURN
Fig.4 Delete Record
35
CASTING VOTE: SUBROUTINE
CASTING VOTE
Display form in Output / Input Mode
Open Database
Check if the Voters ID is valid
Continue?
YES
NO
Display list of Candidates
Has the Voter
Cast his/her Vote?
YES
NO
Cast your vote for selected candidate
Update Database
Close Database
RETURN
Fig.5 Casting Vote
36
DISPLAY / VIEW RESULTS
VIEW RESULT (REPORT)
Display program interface in Output mode
Open Database
Display all contested candidates in a list view
NO
YES
Continue?
Display result of each position
Close Database
RETURN
Fig.6 View Results
37
4.4 Source Code
Private Sub Command1_Click()
frmSystem.Show
Unload Me
End Sub
Private Sub cmdClearDatabase_Click()
If MsgBox("You are about to delete all database entries. Are you sure?", vbQuestion +
vbYesNo, "Confirm Clear Database") = vbNo Then Exit Sub
With Me
.Adodc1.RecordSource = "Candidates"
.Adodc1.Refresh
With Me
.Adodc1.Recordset.Delete
If .Adodc1.Recordset.BOF = False Then
.Adodc1.Recordset.MoveFirst
While Not .Adodc1.Recordset.EOF
.Adodc1.Recordset.Delete
.Adodc1.Recordset.MoveNext
Wend
End If
End With
.Adodc1.RecordSource = "Mwananchi"
.Adodc1.Refresh
With Me
.Adodc1.Recordset.Delete
If .Adodc1.Recordset.BOF = False Then
.Adodc1.Recordset.MoveFirst
While Not .Adodc1.Recordset.EOF
.Adodc1.Recordset.Delete
.Adodc1.Recordset.MoveNext
Wend
End If
End With
.Adodc1.RecordSource = "ImageW"
.Adodc1.Refresh
With Me
.Adodc1.Recordset.Delete
If .Adodc1.Recordset.BOF = False Then
.Adodc1.Recordset.MoveFirst
While Not .Adodc1.Recordset.EOF
.Adodc1.Recordset.Delete
.Adodc1.Recordset.MoveNext
Wend
End If
End With
.Adodc1.RecordSource = "ImageO"
.Adodc1.Refresh
With Me
.Adodc1.Recordset.Delete
If .Adodc1.Recordset.BOF = False Then
.Adodc1.Recordset.MoveFirst
While Not .Adodc1.Recordset.EOF
.Adodc1.Recordset.Delete
.Adodc1.Recordset.MoveNext
Wend
End If
End With
.Adodc1.RecordSource = "Official"
.Adodc1.Refresh
With Me
.Adodc1.Recordset.Delete
39
If .Adodc1.Recordset.BOF = False Then
.Adodc1.Recordset.MoveFirst
While Not .Adodc1.Recordset.EOF
.Adodc1.Recordset.Delete
.Adodc1.Recordset.MoveNext
Wend
End If
End With
.Adodc1.RecordSource = "Vote"
.Adodc1.Refresh
With Me
.Adodc1.Recordset.Delete
If .Adodc1.Recordset.BOF = False Then
.Adodc1.Recordset.MoveFirst
While Not .Adodc1.Recordset.EOF
.Adodc1.Recordset.Delete
.Adodc1.Recordset.MoveNext
Wend
End If
End With
.Adodc1.RecordSource = "Images"
.Adodc1.Refresh
With Me
.Adodc1.Recordset.Delete
If .Adodc1.Recordset.BOF = False Then
.Adodc1.Recordset.MoveFirst
While Not .Adodc1.Recordset.EOF
.Adodc1.Recordset.Delete
.Adodc1.Recordset.MoveNext
Wend
End If
End With
40
End With
End Sub
Private Sub lshortcut_Click()
Dim askmelogout As Single
On Error Resume Next
Unload MDIForm1.ActiveForm
Select Case Me.lshortcut.SelectedItem.Key
Case "Candidate": frmCandidate.Show
Case "elecres": frmResults.Show
Case "electwin": frmwinner.Show: Unload Me.ActiveForm: Me.Hide
Case "logout":
askmelogout = MsgBox("Continue log - out?", vbOKCancel + vbQuestion,
"KENYAN'S ELECTION")
If askmelogout = vbOK Then
frmSystem.Show
End If
Case "Mwananchi": frmMwananchi.Show
Case "Official": frmElectrolBoard.Show
Case "report": frmreport.Show
Case "change": Unload mdiMain.ActiveForm: frmchange.Show
Case "Ballot box": frmVote.Show
End Select
End Sub
Private Sub lshortcut_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As
Single)
If Button = vbRightButton Then
PopupMenu myright
End If
End Sub
41
Private Sub MDIForm_Load()
With Me.lshortcut
Set .SmallIcons = ImageList1
Set .Icons = ImageList1
'For Sales
.ListItems.Add , "Candidate", "Candidate Info", 1, 1
.ListItems.Add , "elecres", "Election Result", 2, 2
.ListItems.Add , "Mwananchi", "Mwananchi's Info", 3, 3
.ListItems.Add , "Official", "Official", 4, 4
.ListItems.Add , "logout", "Log-out ", 5, 5
.ListItems.Add , "report", "Report", 6, 6
.ListItems.Add , "change", "My Account", 7, 7
.ListItems.Add , "Ballot box", "Ballot Box", 8, 8
End With
If Format(dtpDate, "dddd - MMMM dd, yyyy") <> Format(Date, "dddd - MMMM dd,
yyyy") Then dtpDate = Date
lblTime = Format(Time, "hh:mm:ss AM/PM")
End Sub
Private Sub MDIForm_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As
Single)
If Button = vbRightButton Then
PopupMenu myright1
End If
End Sub
Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim askmequit As Single
askmequit = MsgBox("Close application?", vbYesNo + vbQuestion, "KENYAN'S
ELECTION")
If askmequit = vbYes Then
End
42
Else
Cancel = 1
End If
End Sub
Private Sub MDIForm_Resize()
On Error Resume Next
Me.WindowState = 2
End Sub
Private Sub mnuclose2_Click()
On Error Resume Next
Unload mdiMain.ActiveForm
End Sub
Private Sub mnuclose_Click()
On Error Resume Next
Unload mdiMain.ActiveForm
End Sub
Private Sub mnuexit_Click()
Dim askmequit As Single
askmequit = MsgBox("Close application?", vbYesNo + vbQuestion, "KENYAN'S
ELECTION")
If askmequit = vbYes Then
End
Else
Cancel = 1
End If
End Sub
Private Sub mnulogout_Click()
Dim askmelogout As Single
43
askmelogout = MsgBox("Continue log - out?", vbOKCancel + vbQuestion, "KENYAN'S
ELECTION")
If askmelogout = vbOK Then
frmSystem.Show: Unload Me.ActiveForm: Me.Hide
End If
End Sub
Private Sub mnuOpen_Click()
lshortcut_Click
End Sub
Private Sub mnuLogin_Click()
Dim askmelogin As Single
askmelogin = MsgBox("Please Select from the System Security", vbOKCancel +
vbQuestion, "Kenyan's Election")
If askmelogin = vbOK Then
frmSystem.Show
mdiMain.ActiveForm.Refresh
End If
End Sub
Private Sub mnurefresh_Click()
On Error Resume Next
mdiMain.ActiveForm.Refresh
End Sub
Private Sub tmrDateTime_Timer()
lblTime.Caption = " & Time()"
dtpDate = " & Date & "
End Sub
Private Sub tmrLoadDatabase_Timer()
44
frmLoadDatabase.Show 1
tmrLoadDatabase.Enabled = False
End Sub
Option Explicit
Public FN As String
Public FT As String
Public Sub unlockedme()
With Me
.txtid.Locked = False
.txtfn.Locked = False
.txtln.Locked = False
.txtmi.Locked = False
.cboAge.Visible = True
.cboGender.Visible = True
.cboConstituency.Visible = True
.cboPosition.Visible = True
.cboParty.Visible = True
.dtpDateRegistred.Visible = True
.txtPic.Visible = True
.Picture1.Picture = LoadPicture(FN)
.cmdadd.Enabled = False
.cmdsave.Enabled = True
.cmddel.Caption = "Cancel"
.cmdedit.Enabled = False
.txtge.Visible = False
.txtgende.Visible = False
.txtcon.Visible = False
.txtpos.Visible = False
.txtpart.Visible = False
.txtDateregistered.Visible = False
.c1.Enabled = False
45
.c2.Enabled = False
.c3.Enabled = False
.c4.Enabled = False
' .cbocourse.List (1)
' .cbosex.List (1)
End With
End Sub
Public Sub lockedme()
With Me
.txtid.Locked = True
.txtfn.Locked = True
.txtln.Locked = True
.txtmi.Locked = True
.cboAge.Visible = False
.cboGender.Visible = False
.cboConstituency.Visible = False
.cboPosition.Visible = False
.cboParty.Visible = False
.dtpDateRegistred.Visible = False
.txtPic.Visible = True
.Picture1.Visible = True
.cmdadd.Enabled = True
.cmdedit.Enabled = True
.cmdsave.Enabled = False
.cmddel.Caption = "Delete"
.txtge.Visible = True
.txtgende.Visible = True
.txtcon.Visible = True
.txtpos.Visible = True
.txtpart.Visible = True
.txtDateregistered.Visible = True
.c1.Enabled = True
46
.c2.Enabled = True
.c3.Enabled = True
.c4.Enabled = True
End With
End Sub
Private Sub c1_Click()
Me.Adodc1.Recordset.MoveFirst
Me.Adodc2.Recordset.MoveFirst
End Sub
Private Sub c2_Click()
With Me.Adodc1.Recordset
.MovePrevious
If .BOF Then .MoveFirst
End With
With Me.Adodc2.Recordset
.MovePrevious
If .BOF Then .MoveFirst
End With
End Sub
Private Sub c3_Click()
With Me.Adodc1.Recordset
.MoveNext
If .EOF Then .MoveLast
End With
With Me.Adodc2.Recordset
.MoveNext
If .EOF Then .MoveLast
End With
End Sub
Private Sub c4_Click()
47
Me.Adodc1.Recordset.MoveLast
Me.Adodc2.Recordset.MoveLast
End Sub
Private Sub cboAge_Change()
Me.txtge.Text = Me.cboAge.Text
End Sub
Private Sub cboAge_Click()
Me.txtge.Text = Me.cboAge.Text
End Sub
Private Sub cboConstituency_Change()
Me.txtcon.Text = Me.cboConstituency.Text
End Sub
Private Sub cboConstituency_Click()
Me.txtcon.Text = Me.cboConstituency.Text
End Sub
Private Sub cboGender_Change()
Me.txtgende.Text = Me.cboGender.Text
End Sub
Private Sub cboGender_Click()
Me.txtgende.Text = Me.cboGender.Text
End Sub
Private Sub cmdadd_Click()
With Me
Call unlockedme
.txtid.SetFocus
48
.Adodc1.Recordset.AddNew
.cmdedit.Enabled = False
End With
End Sub
Private Sub cmdBrowse_Click()
Dim bytData() As Byte
Dim strDescription As String
On Error GoTo err
With cdlg1 'remember the common dialog box.
.Filter="(*.bmp;*.jpg;*.gif;*.dat;*.pcx)|*.bmp;*.jpg;*.gif;*.dat;*.pcx;|(*.psd)|*.psd|(*.All
files)|*.*" 'filtering so only jpg's and gifs are shown!
.DialogTitle = "Select Picture" 'sets the title of it.
.ShowOpen ' show the open dialog box.
Open .FileName For Binary As #1 'bit to "convert" the image to binary.
ReDim bytData(FileLen(.FileName))
End With
Get #1, , bytData
Close #1
strDescription = InputBox("Enter description.", "New Picture") 'show a input box to enter
description to the description to the description field
With Me
.Adodc2.Recordset.AddNew
.Adodc2.Recordset.Fields("Description") = strDescription
.Adodc2.Recordset.Fields("Passport").AppendChunk bytData
.Adodc2.Recordset.Update
End With
FillFields
Exit Sub
err:
49
If err.Number = 32755 Then 'simple error check.
Else
MsgBox err.Description
err.Clear
End If
End Sub
Public Sub FillFields()
If Not (Adodc2.Recordset.BOF And Adodc2.Recordset.EOF) Then
txtPic = Adodc2.Recordset.Fields("Description")
Set Picture1.DataSource = Adodc2.Recordset
Picture1.DataField = "Passport"
End If
End Sub
Private Sub cmddel_Click()
Dim askmedel As Single
Dim mydelete As String
With Me
If .cmddel.Caption = "Delete" Then
askmedel = MsgBox("Are you sure you want to delete this record?", vbYesNo +
vbQuestion, "KENYAN'S ELECTION")
If askmedel = vbYes Then
mydelete = .Adodc1.Recordset.Fields("cIDNo")
.Adodc1.Recordset.Delete
.Adodc1.Recordset.MoveNext
If .Adodc1.Recordset.EOF Then: .Adodc1.Refresh
With Me.Adodc2.Recordset
If askmedel = vbYes Then
mydelete = .Fields("Description")
.Delete
50
.MoveNext
If .EOF Then: .MoveLast
FillFields
End If
End With
End If
.Adodc1.Refresh
.Adodc2.Refresh
.Adodc1.Refresh
.Adodc2.Refresh
.Refresh
Else
On Error Resume Next
.Adodc1.Recordset.CancelUpdate
.Adodc2.Recordset.CancelUpdate
Call lockedme
.Refresh
.Refresh
End If
End With
End Sub
Private Sub cmdedit_Click()
With Me
Call unlockedme
End With
End Sub
Private Sub cmdExit_Click()
Unload Me
51
End Sub
Private Sub cmdFind_Click()
Dim i, j As Integer
If Me.txtfind.Text <> "" Then
With Me.MSHFlexGrid1
.FillStyle = flexFillRepeat
.Col = 0
.Row = 0
.ColSel = .Cols - 1
.RowSel = .Rows - 1
.CellFontBold = False
.FillStyle = flexFillSingle
For i = 0 To .Cols - 1
For j = 1 To .Rows - 1
If InStr(UCase(.TextMatrix(j, i)), UCase(Me.txtfind.Text)) Then
.Col = i
.Row = j
.CellFontBold = True
End If
Next j
Next i
End With
End If
End Sub
Private Sub cmdgo_Click()
With Me
If .cbosort.ListIndex = 1 Then
If .optsurname.Value Then
.Adodc1.Recordset.Sort = "cLName ASC"
ElseIf .optstud.Value = True Then
52
.Adodc1.Recordset.Sort = "cIDNo ASC"
End If
ElseIf .cbosort.ListIndex = 2 Then
If .optsurname.Value Then
.Adodc1.Recordset.Sort = "cLName DESC"
ElseIf .optstud.Value = True Then
.Adodc1.Recordset.Sort = "cIDNo DESC"
End If
End If
End With
End Sub
Private Sub cmdsave_Click()
With Me
If .txtid.Text <> "" And .txtfn.Text <> "" And .txtln.Text <> "" And .txtmi.Text <> "" _
And .cboAge.Text <> "" And .cboGender.Text <> "" And .cboConstituency.Text <> "" _
And .cboPosition.Text <> "" And .cboParty.Text <> "" And .dtpDateRegistred <> ""
Then
.Adodc1.Recordset.Fields("cIDNo") = txtid
.Adodc1.Recordset.Fields("cFName") = txtfn
.Adodc1.Recordset.Fields("cLName") = txtln
.Adodc1.Recordset.Fields("cMInitial") = txtmi
.Adodc1.Recordset.Fields("Age") = cboAge
.Adodc1.Recordset.Fields("Gender") = cboGender
.Adodc1.Recordset.Fields("cConstituency") = cboConstituency
.Adodc1.Recordset.Fields("cPosition") = cboPosition
.Adodc1.Recordset.Fields("cParty") = cboParty
.Adodc1.Recordset.Fields("Date Registred") = dtpDateRegistred
.Adodc1.Recordset.Update
.Adodc1.Refresh
.Adodc1.Refresh
Me.Refresh
53
Call lockedme
MsgBox "Record Successfully saved", vbInformation, "Kenyans's Election"
Else
MsgBox "Please Fill Out All Requirements", vbOKOnly + vbInformation, "Kenyans's
Election"
Me.txtid.SetFocus
Me.txtid = ""
Exit Sub
End If
End With
End Sub
Private Sub dtpDateRegistred_Change()
Me.dtpDateRegistred.Value = Format$(Date, "MMMM DD, YYYY")
End Sub
Private Sub dtpDateRegistred_Click()
Me.dtpDateRegistred.Value = Format$(Date, "MMMM DD, YYYY")
End Sub
Private Sub Form_Activate()
Me.WindowState = 2
'Me.Adodc2.Refresh
Me.dtpDateRegistred.Value = Format$(Date, "MMMM DD, YYYY")
Me.txtDateregistered.Text = Format$(Date, "MMMM DD, YYYY")
Me.cbosort.ListIndex = 0
End Sub
Private Sub txtfind_Change()
cmdFind_Click
End Sub
Private Sub txtfind_KeyDown(KeyCode As Integer, Shift As Integer)
54
If KeyCode = vbKeyBack Then
cmdFind_Click
End If
End Sub
Private Sub txtfind_KeyUp(KeyCode As Integer, Shift As Integer)
cmdFind_Click
End Sub
Option Explicit
Public CountV As Integer
Dim myCandidate As New clsPresident
Dim sPosition As String
Dim myCriteria, myTarget As String
Dim ctr As Integer
Dim sql, vot As String
Dim candidateDetails As String
Dim candidateDetail1 As String
Dim candidateDetail2 As String
Dim ListIndex As Integer
Dim President_ID(100) As String
Dim MP_ID(100) As String
Dim Senators_ID(100) As String
Dim Councillor_ID(100) As String
Dim President_Party(100) As String
Dim MP_Party(100) As String
Dim Senators_Party(100) As String
Dim Councillor_Party(100) As String
55
Dim President_Constituency(100) As String
Dim MP_Constituency(100) As String
Dim Senators_Constituency(100) As String
Dim Councillor_Constituency(100) As String
Dim President_FName(100) As String
Dim MP_FName(100) As String
Dim Senators_FName(100) As String
Dim Councillor_FName(100) As String
Dim President_LName(100) As String
Dim MP_LName(100) As String
Dim Senators_LName(100) As String
Dim Councillor_LName(100) As String
Dim intLoopIndex
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdsubmit_Click()
Dim wIDNo As String
Dim wIDNo2 As String
wIDNo2 = Me.lblIDNo.Caption
Me.AdoVote.Refresh
With Me
Me.AdoVote.Refresh
AdoVote.Recordset.Find "mIDNo='" & wIDNo2 & "'"
MsgBox "You have already submitted your ballot.", vbExclamation, "Kenyan's
Election's"
56
If AdoVote.Recordset.EOF Then
Save_President lstPresident, wIDNo
Save_Member lstMember, wIDNo
Save_Senators lstSenators, wIDNo
Save_Councillor lstCouncillor, wIDNo
If lstPresident.SelCount <= 0 And lstMember.SelCount <= 0 And
lstSenators.SelCount <= 0 And lstCouncillor.SelCount <= 0 Then
MsgBox "No votes has been save. Please choose candidate(s) to vote",
vbInformation, " Voting System"
Exit Sub
End If
VoteStatus
MsgBox "Thank you for Voting...", vbInformation, " Voting System"
End If
End With
Me.AdoVote.Refresh
End Sub
Private Sub Form_Activate()
With Me
FramePresident.Enabled = True
FrameMP.Enabled = True
FrameSenators.Enabled = True
FrameCouncillors.Enabled = True
End With
With Me
Set myCandidate = New clsPresident
Adodc6.LockType = adLockPessimistic
Adodc6.CursorType = adOpenStatic
List_President lstPresident
57
List_MP lstMember
List_Senator lstSenators
List_Councillor lstCouncillor
End With
End Sub
Function List_President(lst As ListBox)
If Adodc6.Recordset.State = adStateOpen Then
Adodc6.Recordset.Close
End If
Adodc6.Refresh
ctr = Adodc6.Recordset.RecordCount
If ctr <= 0 Then Exit Function
Adodc6.Recordset.MoveFirst
For ctr = 0 To ctr – 1
President_ID(ctr) = Adodc6.Recordset.Fields("cIDNo")
President_Party(ctr) = Adodc6.Recordset.Fields("cParty")
President_Constituency(ctr) = Adodc6.Recordset.Fields("cConstituency")
President_FName(ctr) = Adodc6.Recordset.Fields("cFName")
President_LName(ctr) = Adodc6.Recordset.Fields("cLName")
candidateDetails = Adodc6.Recordset.Fields("cLName") & "," &
Adodc6.Recordset.Fields("cFName") & "--->" & Adodc6.Recordset.Fields("cConstituency")
& "," & Adodc6.Recordset.Fields("cParty")
lst.AddItem candidateDetails
Adodc6.Recordset.MoveNext
Next ctr
End Function
Function List_MP(lst As ListBox)
58
If Adodc3.Recordset.State = adStateOpen Then
Adodc3.Recordset.Close
End If
Adodc3.Refresh
ctr = Adodc3.Recordset.RecordCount
If ctr <= 0 Then Exit Function
Adodc3.Recordset.MoveFirst
For ctr = 0 To ctr – 1
MP_ID(ctr) = Adodc3.Recordset.Fields("cIDNo")
MP_Party(ctr) = Adodc3.Recordset.Fields("cParty")
MP_Constituency(ctr) = Adodc3.Recordset.Fields("cConstituency")
MP_FName(ctr) = Adodc3.Recordset.Fields("cFName")
MP_LName(ctr) = Adodc3.Recordset.Fields("cLName")
candidateDetails = Adodc3.Recordset.Fields("cLName") & "," &
Adodc3.Recordset.Fields("cFName") & "--->" & Adodc3.Recordset.Fields("cConstituency")
& "," & Adodc3.Recordset.Fields("cParty")
lst.AddItem candidateDetails
Adodc3.Recordset.MoveNext
Next ctr
End Function
Function List_Councillor(lst As ListBox)
If Adodc4.Recordset.State = adStateOpen Then
Adodc4.Recordset.Close
End If
Adodc4.Refresh
ctr = Adodc4.Recordset.RecordCount
If ctr <= 0 Then Exit Function
59
Adodc4.Recordset.MoveFirst
For ctr = 0 To ctr - 1
Councillor_ID(ctr) = Adodc4.Recordset.Fields("cIDNo")
Councillor_Party(ctr) = Adodc4.Recordset.Fields("cParty")
Councillor_Constituency(ctr) = Adodc4.Recordset.Fields("cConstituency")
Councillor_FName(ctr) = Adodc4.Recordset.Fields("cFName")
Councillor_LName(ctr) = Adodc4.Recordset.Fields("cLName")
candidateDetails = Adodc4.Recordset.Fields("cLName") & "," &
Adodc4.Recordset.Fields("cFName") & "--->" & Adodc4.Recordset.Fields("cConstituency")
& "," & Adodc4.Recordset.Fields("cParty")
lst.AddItem candidateDetails
Adodc4.Recordset.MoveNext
Next ctr
End Function
Function List_Senator(lst As ListBox)
If adoreport.Recordset.State = adStateOpen Then
adoreport.Recordset.Close
End If
adoreport.Refresh
ctr = adoreport.Recordset.RecordCount
If ctr <= 0 Then Exit Function
adoreport.Recordset.MoveFirst
For ctr = 0 To ctr - 1
Senators_ID(ctr) = adoreport.Recordset.Fields("cIDNo")
Senators_Party(ctr) = adoreport.Recordset.Fields("cParty")
Senators_Constituency(ctr) = adoreport.Recordset.Fields("cConstituency")
60
Senators_FName(ctr) = adoreport.Recordset.Fields("cFName")
Senators_LName(ctr) = adoreport.Recordset.Fields("cLName")
candidateDetails = adoreport.Recordset.Fields("cLName") & "," &
adoreport.Recordset.Fields("cFName")&"--->"&
adoreport.Recordset.Fields("cConstituency") & "," & adoreport.Recordset.Fields("cParty")
lst.AddItem candidateDetails
adoreport.Recordset.MoveNext
Next ctr
End Function
Private Sub lstCouncillor_Click()
If lstCouncillor.SelCount >= 1 Then
FrameCouncillors.Enabled = True
End If
End Sub
Private Sub lstPresident_Click()
If lstPresident.SelCount >= 1 Then
FramePresident.Enabled = True
End If
End Sub
Private Sub lstSenators_Click()
If lstSenators.SelCount >= 1 Then
FrameSenators.Enabled = True
End If
End Sub
Private Sub lstMember_Click()
If lstMember.SelCount >= 1 Then
FrameMP.Enabled = True
61
End If
End Sub
Function Save_President(lst As ListBox, wIDNo As String)
Dim X, gText, i As Integer
Dim cLName, cFName, Constituency As String
Me.Adodc2.Refresh
If Adodc6.Recordset.State = adStateOpen Then
Adodc6.Recordset.Close
End If
Adodc6.Refresh
If lst.SelCount = 0 Then
Exit Function
Else
intLoopIndex = lst.ListCount
For intLoopIndex = 0 To lst.ListCount - 1
If lst.Selected(intLoopIndex) = True Then
With Me
AdoVote.Refresh
With Me
gText = toNumber(lstPresident.Text) + 1
wIDNo = Me.lblIDNo
cLName = Adodc6.Recordset.Fields("cLName")
cFName = Adodc6.Recordset.Fields("cFName")
AdoVote.Recordset.AddNew
AdoVote.Recordset.Fields("mIDNO") = wIDNo
AdoVote.Recordset.Fields("cIDNO") = President_ID(intLoopIndex)
62
AdoVote.Recordset.Fields("cFName") = President_FName(intLoopIndex)
AdoVote.Recordset.Fields("cLName") = President_LName(intLoopIndex)
AdoVote.Recordset.Fields("Position") = "President"
AdoVote.Recordset.Fields("Party") = President_Party(intLoopIndex)
AdoVote.Recordset.Fields("Constituency") =
President_Constituency(intLoopIndex)
AdoVote.Recordset.Fields("Count") = gText
AdoVote.Recordset.Update
End With
End With
End If
Next intLoopIndex
End If
Me.Adodc2.Refresh
End Function
Function Save_Member(lst As ListBox, wIDNo As String)
Dim X, i, gText As Integer
Dim cLName, cFName, Constituency As String
Me.Adodc2.Refresh
If Adodc3.Recordset.State = adStateOpen Then
Adodc3.Recordset.Close
End If
Adodc3.Refresh
If lst.SelCount = 0 Then
Exit Function
Else
intLoopIndex = lst.ListCount
For intLoopIndex = 0 To intLoopIndex - 1
63
If lst.Selected(intLoopIndex) = True Then
With Me
AdoVote.Refresh
With Me
gText = toNumber(lstMember.Text) + 1
wIDNo = Me.lblIDNo
cLName = Adodc3.Recordset.Fields("cLName")
cFName = Adodc3.Recordset.Fields("cFName")
Constituency = Adodc3.Recordset.Fields("cConstituency")
AdoVote.Recordset.AddNew
AdoVote.Recordset.Fields("mIDNO") = wIDNo
AdoVote.Recordset.Fields("cIDNO") = MP_ID(intLoopIndex)
AdoVote.Recordset.Fields("cFName") = MP_FName(intLoopIndex)
AdoVote.Recordset.Fields("cLName") = MP_LName(intLoopIndex)
AdoVote.Recordset.Fields("Position") = "MP"
AdoVote.Recordset.Fields("Party") = MP_Party(intLoopIndex)
AdoVote.Recordset.Fields("Constituency") =
MP_Constituency(intLoopIndex)
AdoVote.Recordset.Fields("Count") = gText
AdoVote.Recordset.Update
End With
End With
End If
Next intLoopIndex
End If
Me.Adodc2.Refresh
End Function
64
Function Save_Senators(lst As ListBox, wIDNo As String)
Dim X, i, gText As Integer
Dim cLName, cFName, Constituency As String
Me.Adodc2.Refresh
If adoreport.Recordset.State = adStateOpen Then
adoreport.Recordset.Close
End If
adoreport.Refresh
If lst.SelCount = 0 Then
Exit Function
Else
intLoopIndex = lst.ListCount
For intLoopIndex = 0 To intLoopIndex - 1
If lst.Selected(intLoopIndex) = True Then
With Me
AdoVote.Refresh
With Me
gText = toNumber(lstSenators.Text) + 1
wIDNo = Me.lblIDNo
Constituency = adoreport.Recordset.Fields("cConstituency")
cLName = adoreport.Recordset.Fields("cLName")
cFName = adoreport.Recordset.Fields("cFName")
AdoVote.Recordset.AddNew
AdoVote.Recordset.Fields("mIDNO") = wIDNo
AdoVote.Recordset.Fields("cIDNO") = Senators_ID(intLoopIndex)
AdoVote.Recordset.Fields("cFName") = Senators_FName(intLoopIndex)
AdoVote.Recordset.Fields("cLName") = Senators_LName(intLoopIndex)
AdoVote.Recordset.Fields("Position") = "Senator"
AdoVote.Recordset.Fields("Party") = Senators_Party(intLoopIndex)
65
AdoVote.Recordset.Fields("Constituency") =
Senators_Constituency(intLoopIndex)
AdoVote.Recordset.Fields("Count") = gText
AdoVote.Recordset.Update
End With
End With
End If
Next intLoopIndex
End If
Me.Adodc2.Refresh
End Function
Function Save_Councillor(lst As ListBox, wIDNo As String)
Dim X, i, gText As Integer
Dim cLName, cFName, Constituency As String
Me.Adodc2.Refresh
If Adodc4.Recordset.State = adStateOpen Then
Adodc4.Recordset.Close
End If
Adodc4.Refresh
If lst.SelCount = 0 Then
Exit Function
Else
intLoopIndex = lst.ListCount
For intLoopIndex = 0 To intLoopIndex - 1
If lst.Selected(intLoopIndex) = True Then
With Me
AdoVote.Refresh
66
With Me
gText = toNumber(lstCouncillor.Text) + 1
wIDNo = Me.lblIDNo
Constituency = Adodc4.Recordset.Fields("cConstituency")
cLName = Adodc4.Recordset.Fields("cLName")
cFName = Adodc4.Recordset.Fields("cFName")
AdoVote.Recordset.AddNew
AdoVote.Recordset.Fields("mIDNO") = wIDNo
AdoVote.Recordset.Fields("cIDNO") = Councillor_ID(intLoopIndex)
AdoVote.Recordset.Fields("cFName") = Councillor_FName(intLoopIndex)
AdoVote.Recordset.Fields("cLName") = Councillor_LName(intLoopIndex)
AdoVote.Recordset.Fields("Position") = "Councillor"
AdoVote.Recordset.Fields("Party") = Councillor_Party(intLoopIndex)
AdoVote.Recordset.Fields("Constituency") =
Councillor_Constituency(intLoopIndex)
AdoVote.Recordset.Fields("Count") = gText
AdoVote.Recordset.Update
End With
End With
End If
Next intLoopIndex
End If
Me.Adodc2.Refresh
End Function
Function Check_Voter()
Dim wIDNo As String
wIDNo = Me.lblIDNo
Me.AdoVote.Refresh
67
With Me.AdoVote.Recordset
.Find "mIDNo='" & wIDNo & "'"
If .Fields("mIDNo") = wIDNo Then
MsgBox "You have already submitted you ballot.", vbExclamation, "Kenyan's Election"
Else
End
End If
End With
Me.AdoVote.Refresh
End Function
Private Sub VoteStatus()
With Me.Adodc2.Recordset
.Find "mIDNo='" & lblIDNo & "'"
.Fields("Voted") = True
.Update
End With
End Sub
' Search a control's ItemData property for the
' indicated ID. If found select the item.
Public Sub SelectItemData(ctl As Control, lst As ListBox)
Dim nCnt As Long
Dim cIDNo As Integer
Set ctl = Me!lst
For nCnt = 0 To ctl.ListCount - 1
If ctl.ItemData(nCnt) = cIDNo Then
ctl.ListIndex = nCnt
Exit For
End If
68
Next
End Sub
Private Sub cmdclose_Click()
mdiMain.Show
Unload Me
End Sub
Private Sub cmdExit_Click()
exitQ
End Sub
Private Sub ListView_President()
Dim vForm As Form, vListView As ListView, vSQL As String, vStart As Integer, vEnd As
Integer
Me.Adodc1.Refresh
With Me
.lPres.ListItems.Clear
With .Adodc1.Recordset
.Sort = "SumofCount DESC"
If .BOF = False Then
.MoveFirst
While Not .EOF
Set vpubList = Me.lPres.ListItems.Add(, , .Fields("cIDNo") & "")
For vpubLoop = vStart To vEnd
vpubList.SubItems(1) = .Fields("cFName")
vpubList.SubItems(2) = .Fields("cLName")
vpubList.SubItems(3) = .Fields("Position")
vpubList.SubItems(4) = .Fields("Party")
69
vpubList.SubItems(5) = .Fields("Constituency")
vpubList.SubItems(6) = .Fields("SumOfCount")
Next vpubLoop
.MoveNext
Wend
End If
End With
End With
Me.Adodc1.Refresh
End Sub
Private Sub ListView_MP()
Dim vForm As Form, vListView As ListView, vSQL As String, vStart As Integer, vEnd As
Integer
Me.Adodc3.Refresh
With Me
.lMP.ListItems.Clear
With .Adodc3.Recordset
.Sort = "SumofCount DESC"
If .BOF = False Then
.MoveFirst
While Not .EOF
Set vpubList = Me.lMP.ListItems.Add(, , .Fields("cIDNo") & "")
For vpubLoop = vStart To vEnd
vpubList.SubItems(1) = .Fields("cFName")
vpubList.SubItems(2) = .Fields("cLName")
vpubList.SubItems(3) = .Fields("Position")
vpubList.SubItems(4) = .Fields("Party")
70
vpubList.SubItems(5) = .Fields("Constituency")
vpubList.SubItems(6) = .Fields("SumOfCount")
Next vpubLoop
.MoveNext
Wend
End If
End With
End With
Me.Adodc3.Refresh
End Sub
Private Sub ListView_Councillor()
Dim vForm As Form, vListView As ListView, vSQL As String, vStart As Integer, vEnd As
Integer
Me.adowinner.Refresh
With Me
.lvc.ListItems.Clear
With .adowinner.Recordset
.Sort = "SumofCount DESC"
If .BOF = False Then
.MoveFirst
While Not .EOF
Set vpubList = Me.lvc.ListItems.Add(, , .Fields("cIDNo") & "")
For vpubLoop = vStart To vEnd
vpubList.SubItems(1) = .Fields("cFName")
vpubList.SubItems(2) = .Fields("cLName")
vpubList.SubItems(3) = .Fields("Position")
71
vpubList.SubItems(4) = .Fields("Party")
vpubList.SubItems(5) = .Fields("Constituency")
vpubList.SubItems(6) = .Fields("SumOfCount")
Next vpubLoop
.MoveNext
Wend
End If
End With
End With
Me.adowinner.Refresh
End Sub
Private Sub ListView_Senator()
Dim vForm As Form, vListView As ListView, vSQL As String, vStart As Integer, vEnd As
Integer
Me.Adodc2.Refresh
With Me
.lsen.ListItems.Clear
With .Adodc2.Recordset
.Sort = "SumofCount DESC"
If .BOF = False Then
.MoveFirst
While Not .EOF
Set vpubList = Me.lsen.ListItems.Add(, , .Fields("cIDNo") & "")
For vpubLoop = vStart To vEnd
vpubList.SubItems(1) = .Fields("cFName")
vpubList.SubItems(2) = .Fields("cLName")
72
vpubList.SubItems(3) = .Fields("Position")
vpubList.SubItems(4) = .Fields("Party")
vpubList.SubItems(5) = .Fields("Constituency")
vpubList.SubItems(6) = .Fields("SumOfCount")
Next vpubLoop
.MoveNext
Wend
End If
End With
End With
Me.Adodc2.Refresh
End Sub
Private Sub Form_Activate()
On Error Resume Next
ListView_MP
ListView_President
ListView_Councillor
ListView_Senator
Me.adowinner.Refresh
Me.Refresh
End Sub
Option Explicit
Dim total, join, KJ, totalAMPM As Integer
Dim KJpercent, joinpercent, joinAM, joinPMpercent, joinPM, joinAMpercent As Double
Dim itm
Public Sub info()
73
Dim vForm As Form, vListView As ListView, vSQL As String, vStart As Integer, vEnd As
Integer
Me.adojoin.Refresh
With Me.adojoin.Recordset
If .RecordCount <> 0 Then
total = .RecordCount
.MoveFirst
Do Until .EOF
If .Fields("voted") = True Then
join = join + 1
'for those who joined
Set vpubList = Me.lv2.ListItems.Add(, , .Fields("mIDNo") & "")
For vpubLoop = vStart To vEnd
vpubList.SubItems(1) = .Fields("mLName")
vpubList.SubItems(2) = .Fields("mFName")
vpubList.SubItems(3) = .Fields("mConstituency")
vpubList.SubItems(4) = .Fields("mGender")
Next vpubLoop
Else
KJ = KJ + 1
'for those who not joined
Set itm = Me.lv1.ListItems.Add(, , .Fields!mIDNo)
itm.SubItems(1) = .Fields("mLName")
itm.SubItems(2) = .Fields("mFName")
itm.SubItems(3) = .Fields("mConstituency")
itm.SubItems(4) = .Fields("mGender")
End If
.MoveNext
74
Loop
Me.adojoin.Refresh
End If
End With
End Sub
Private Sub cmdclose_Click()
Unload Me
End Sub
Private Sub Form_Activate()
join = 0
total = 0
KJ = 0
Call info
Me.lbltotalstud.Caption = total
Me.lblparticipate.Caption = join
Me.lbldiff.Caption = KJ
'---over all
joinpercent = (join / total)
KJpercent = (KJ / total)
L1.Caption = Format(joinpercent, "0.00%")
L2.Caption = Format(KJpercent, "0.00%")
End Sub
75
4.5 Physical Design
Meanwhile, physical design deals with process converting the logical design into a more
technical specification of the system development. In designing the physical part of the
system, all diagrams that were produced in the logical design were turned into a structured
systems design. During physical design, the researcher determined which programming
language and database system will be used as well as the determination of which hardware
platform, operating systems and network environment the system will run under. The
specifications are as follows:
Table: Hardware and Software Specification
Purpose H/W.S/W Requirements
Programming
Language
Visual Basic 6 and Microsoft Office Access 2003
Operating Systems Microsoft Windows Operating System
(Win98,Windows2000, Windows ME, Windows XP)
Hardware Monitor, CPU, RAM(minimum 512MB) Disk
Space(minimum 40GB), Keyboard and Mouse
The programming part of the study was dependent on the result from the designing process
which include the system’s functions, entities involve, hardware and Operating System
determined. After everything was designed, the physical system specifications were ready to
turn over for the next phase which is the implementation phase.
After all design had been produced, it was then referred for the construction of the e-voting
system in the next phase which is the implementation phase. The construction will involve
writing the programming codes besides setting of hardware and software for development of
the e-voting system.
76
CHAPTER 5
5.0 IMPLEMENTATION
5.1 System Development
For the system development, Visual Basic 6 was used in coding e-voting system. The system
was completely developed with Visual Basic 6, Microsoft Office Access 2003 was used as
Database to store and retrieve all information. The functional requirements that have been
mentioned in the previous chapter has been developed to reach the proposed prototype, in this
chapter will be recalled how developed these functions which are combined with each other to
constitute the e-voting system.
Login Voter and Official
This function has developed to enable both official and voter for entry into the system
as follows. Through login the voter can enter the voting page to vote for candidates.
The vote must enter his ID no. and password.
This function of Official login has been developed as to show that the Official can add
candidates to list of candidates to become a candidate. Official can also add voters so as
to make them capable of voting come Election Day
Fig.7 Log-In
Voting for Candidate
This function has been developed as shown in the figure below for voters to enable
them to vote for candidates in their constituency, in the voting form the name and party
for each candidate appears for them to select one candidate per each category i.e.
77
President, MP, Senator, and Councilors
Fig.8 Voting Process
Admin Login
As shown in figure below the form allows admin to access the admin side of the
software. Administrator adds officials to the database and he/she can also add candidate
and voter as well, view result and etc. The only thing Administrator can’t do is vote.
78
Fig.9 Administrator Login
79
Fig.10 Administrator User Interface
80
Fig.11 Add new candidate
81
Fig.12 Add New Voter/Mwananchi
82
Election Result
This function was developed as shown in figure below to represent the result of the
elections in each faculty. The result can be seen through the faculty selection from the
list of candidates.
Fig.13 View Results User Interface
83
Report
This function was developed as show below to represent the number of registered
voters who participated and who did not participate.
Fig.14 List of Voters who did and who did not participate
5.2 HOW TO RUN THE PROGRAM
The Program for this project, which E-Voting system is stored onto a CD-ROM or flash disk,
and can be run following these steps:
i. Insert the CD-ROM or flash disk into the computer, then access the CD-ROM from
my computer by double clicking the drive icon if it does not come up automatically.
84
ii. Once the CD-ROM is open you see the folder with name E-Voting system, double
click on it to install the program into the system.
iii. To execute (run) the program click E-Voting on the start menu.
The program starts and presents the user with a login window asking the user to enter
username and password: the user should type “admin” in the username textbox and “admin” in
the password textbox to load the main form, which consists of main menu: Candidate Info,
Election Result, Mwananchi’s Info, Official, Log-out, Report, My Account, Ballot Box. When
any of the menu command is clicked, the task associated with it is started.
5.3 Summary
In this chapter, the implementation of the sequence of the several steps for building the system
is discussed. E-voting prototype for the voters was developed. The result of the running system
showed that the objective of the study was achieved successfully. The output of this chapter is
to the developed prototype. The conclusion of the study discussed in the next chapter.
85
CHAPTER 6
6. CONCLUSION
There is much more work to do in developing an efficient and effective system in order to
make the IEEC elections easily and accurately and to help in solving the problems/ the
difficulties in the traditional voting system(ballot box). This study highlighted and
recommended future work.
6.1 Finding
As described in the chapter one, the aim of the study is to design an e-voting system to develop
a prototype for e-voting system.
Research Objective 1:
To design an e-voting system to help in solving the problems of the traditional voting
system that previously mentioned in the problem statement of this research, result are
discussed in chapter four.
Research Objective 2:
To develop a prototype for e-voting system to make the election process within the country
more efficient and accurate, and in order to help of solving the problems or the difficulties in
the traditional voting system (ballot box), results are in chapter five.
6.2 Problems and Limitation
The main problems and limitation of this study (e-voting) are:
The system is vulnerable to attacks on each computer used to vote. These attacks
may disrupt the process of voting or bring the results in question. Which can be
considered as a technical problem?
Recounting of votes is not possible if there were doubts as to the legitimacy of
results with no paper trail for audit.
6.3 Future Work
The research I conducted was to find out the factors that would make e-voting system a success
in Kenya and we limited our work to this extent but there are plenty of other aspects which can
86
be explored or researched for:
Research can be conducted to know how government can create awareness among people to let
them know about the new technologies in use and new ways of handling situations like e-
voting.
Research can be conducted on what infrastructure is needed to support e-voting and how that
infrastructure would help flourish the new system. In the infrastructure there are plenty of
things which are needed to be addressed.
There is huge probability to find out how and what security can be implemented to provide
enough room for the infrastructure to work in proper way and if the security should include
physical parameters/logical parameters to be followed.
There is room for research to find out how the implementation of e-voting should be done as
there is a diversity of different ethnic groups and Kenya is not a small country in relation to
population.
As I targeted my research to the people aged from 18 to 50 so it does not represent the will of
all age groups, in future a research can be conducted to get the views of other age groups as
well. The level of transparency can be an issue for people as well as for the Government.
Therefore a research can be made to know what level of transparency would be sufficient for
the people and the Government at the same time.
6.4 Summary
E-voting system was developed to help registered voters to vote for candidates easily and
accurately and to help in solving problems/ the difficulties in the traditional voting system
(ballot box). The system is tested and result confirms that the proposed system is capable to
record a successful completion of elections and provide an announcement for the results in
efficient and accurate manner
87
References
1. Swartz N. 2004. “E-government Around the World”. Information Management
Journal,38 (1): 12.
2. R. Silcock, what is e-Government
http://pa.oxfordjournals.org/cgi/reprint/54/1/88?ijkey=ef28bcf065b9aeb96a17dc33edb7b
db2b2bc129d
3. Definition of e-democracy
http://en.wikipedia.org/wiki/EDemocracy
4. Dr. Subhash Kapila Consultant, Strategic Affairs with South Asia Analysis Group
http://www.saag.org/papers22/paper2132.html
5. EETimes, Computer experts renew call for secure e-voting
http://www.eetimes.com/news/latest/showArticle.jhtml?articleID=193100139
6. Princeton University, Word Net
http://wordnet.princeton.edu/perl/webwn?s=success
7. Government Information Services of Canada, Glossary
http://www.communication.gc.ca/glossary.html
8. E-Government – Challenges and Opportunities
http://www.w3c.it/papers/cmg2005Italy.pdf
9. What is a Public Information System?
http://www.ijpis.net/issues/no1_2005/IJPIS_no1_2005_p7.pdf
10. M. Sakowicz, How to Evaluate E-Government? Different Methodologies and Methods
http://unpan1.un.org/intradoc/groups/public/documents/nispacee/unpan009486.pdf
11. E-democracy http://en.wikipedia.org/wiki/E-democracy
12. E-democracy http://wiki.media-culture.org.au/index.php/E-Democracy
13. Implementing electronic voting in the UK
http://www.communities.gov.uk/index.asp?id=1133596
14. Electronic voting and counting http://www.elections.act.gov.au/Elecvote.html
15. E-voting in New Zealand http://www.e.govt.nz
16. E-Government Fact sheet - Lithuania
http://ec.europa.eu/idabc/en/document/6383/403
17. Internet Voting: Will it Spur or Corrupt Democracy? Lance J. Hoffman
88
http://www.cfp2000.org/papers/hoffman2.pdf
18. How E-Voting Threatens Democracy
http://www.wired.com/politics/security/news/2004/03/62790
19. E-democracy http://en.wikipedia.org/wiki/Democracy
20. Diebold systems http://www.diebold.com/dieboldes
21. Implementing projects through ICT http://www.itu.int/ITU-D/e-strategies/e-
security/index.html
22. Trochim W. (2001).The Research Methods Knowledge Base (2nded.), Atomic Dog Pub
Inc.
23. Leedy, P, & Ormrod, J. 2005.Practical research – Planning and design (8thed.).
PearsonEducation.
Upper Saddle River, New Jersey. USA.
24. Yin, R.K. (2003).Case study research: Design and Methods, Third edition, Sage
publications, Inc.
25. Gay, L. R., & Airasian, P. (2003).Educational research: Competencies for analysis and
application (7thed.). New York: Modern Language Association.
26. Aviel, D., & Rubin, K. (2001). Security Considerations for Remote Voting,
Communication of the ACM
27. Chen, Y. (2004) the design of a secure anonymous Internet voting system. ELSEVIER
computer and security.
28. Ibrahim, S. (2003). Secure E-voting with blind signature. Telecommunication
Technology 193-197
29. Siler, Brain; Spootts, Jeff; Mckelvy, Michael (1998) Special Edition Using Visual Basic
6, Pearson Education Inc.
30. Francesco Balena (1999) Programming Microsoft Visual Basic 6
31. Steven Holzner (1998) Visual Basic 6 Black Book
32. SAMS (2000) Visual Basic 6 Database How-To, Macmillan Computer Publishing.
33. Vincent Himpe (2002) Visual Basic for Electronic Engineering Application 2nd Edition.
89
Appendix – Questions for the survey
1. What’s your age?
under 18
18-25
26-35
36-45
45-60
over 60
2. What’s your gender?
Male
Female
3. What part of Kenya are you from?(by Constituency)
List of Kenya’s 290 Constituency
4. What is the level of your education?
School
College
University
Others
5. What is the level of your computer experience?
Novice
Average
Advanced
Expert
6. Do you use e-Government services?
Yes
No
7. Do you think that voting in Kenya is held democratically?
Yes
No
8. Do you think voting results are affected by the human-factor?
Yes, in a good way
90
Yes, in a bad way
Not at all
9. Do you think human-factor could be avoided/minimized by using computers?
Yes
No
10. What way of voting is the most suitable for you?
Paper-based voting (the one used in Kenya at the moment)
Electronic voting (when e-voting machines are used to conduct voting)
11. Do you think is a need of implementing e-voting system in Kenya?
Yes
No
12. If so, then why do you think it’s needed?
Elections are rigged
There are many complains from citizens and political parties about the elections
being unfair
Staff on polling booths influence voting results
It takes too long to calculate voting results
Political parties influence voting results by appointing their members as staff on
the polling booth
Government can affect results of the voting by manipulating them
Votes are calculated by people. So they can cheat or miscount them
No
13. Do you think that use of computers may affect the way people vote?
Yes, in a good way
Yes, in a bad way
Not at all
14. In your opinion what way of authentication is the most appropriate for e-voting?
Login and Password
Scratch-codes
Issued certificates to access government’s system
Digital signature
Biometrical access(thumb-scans, eye-scans)
91
Others
15. Do you think you can rely on results from this kind of voting?
Yes
No
16. Do you think that in the future e-voting can replace present way of voting on permanent
bases?
Yes
No
17. Should the votes be printed as well along with electronic storage?
Yes
No
18. If votes are printed, when they can be used?
Keep them for official records
Use them to calculate voting results if e-voting machine malfunctions
Use them to calculate voting results if any controversy arises
Use them to calculate voting results along with machine’s calculations
Other
19. What kind of information should be displayed on screens?
Candidate’s name
Candidate’s photo
20. What is the better way to cast the vote through e-voting machines?
By using touch-screen
By using buttons around the screen(like in the ATM)
By using Personal Computer
Other
21. Who in your opinion should have access to the voting machines to retrieve the results?
Electoral Commission
Judiciary
Military
Other
22. Who should develop the machines?
Local companies
92
Government bodies
Foreign companies
23. How much money government should put in developing e-voting system?
As low as possible
Enough to provide a solution that can cater the basic needs of e-voting system
As much as possible
24. What languages should be used to display information on the e-voting machines?
English only
Kiswahili only
English and Kiswahili
All regional languages
25. Comment
User can leave any comments or ideas he has about the subject or survey itself
93