SMART CARD DATABASE PROGRAMMING
1L1LLlAL1"l UN 5A'ADL11i B l. SA' a1 )f
``ý4
AI. A 1, ý%9 I,
ýM
.ºý
Q, Ivy
G .:
*
ý' I A1 P'
UNIVERSITI MALAYSIA SARAWAK
2003
Universiti Malaysia Sarawak Kota Ssmargan
fk
BORANG PENYERAHAN TESXS
lodul: Smart Card Database Programming
SESI PENCA, iIAN: 19"-2002 Saya HALL(MATOti SA'ADiAH BT SA'ADt
(HI'RIEt BESAR)
meaqalw membenerican tests vu dnimpan db Pusat Khuimat Maklumat Akadm*, Uadvrtsiti Malaysia Sarawak dengan s`arat-sýarat kegseiaan eepertº benkto
I Nakmºlrk kcxtas pTO-%k ad" di bawah name pwouüa mclamkm panulisan sebtO pcyaic baumt daa drbrnm oJeh LNIMAS, hakrnilikma adalah kcpumaaa L'hI? ºtAS
2 Nukhah salutan di datacn Ixntuk ktxtas atau nukTo hama both dibuat dat, gaa lubawram batalis danpada pawlis
1 Pusat Khidrnu Makhanat Akadaaik (P. riMAS (bbasrkan marmua aslrmn uoWk paWian mraeira.
4 Kcrtat progek ham a bokh ditabukan deugao kebaRaran peoulit k-aran royaki adalab mmgilait kadar ýang dipcrsotuJm lenk
a " Sm a manbamkartidak manberuukan Papuatakaaa mcmMuet ulioan kertn pmXk sp aebao babas pertukaran dr wars mstitt>: i pengajian tinggt.
'" Srla tandakan t -v)
SUL1T (McngarAmgi mAIurrua sang badar}aA Ixtelantatm Mau kgratirRan
Malaagia scpCrts sang tcrnWdknrb di dahm AKTA RAHSIA RASM11971),
TERHAD (Mengandmgi mahlwrut TERHAD yang t fr1h ditafi i deb orgeniuaif baden di wenn Pmnviahkar di aladcan).
ýýi TIDAK TERHAD
(TANDATANGAN PENULTS)
Altnat tctap NO 9 KAMPUNG PApANG, 98200 N{AH, M1R1, SARAWAK
tarth
11-03-63
EN, M+ttUa MtYt
( Nemt PanW)
ruüh If d, O
CATATAh " P. twq ymg M4k `ertiewaa
"" Aka Kertr Pnjek WA SULIT a4s TIRHAD, Wk hsiPklur Mut ir1P" Pi" Mrbr"
orpmY. d Meintwaas +wps Mene+alw akni( ""Wh Mret PeOJIL W Patit irainlrwe abapi SUIT atas Ti? ItHAD.
APPROVAL SHEET
This project report attached hereto, entitled "SMART CARD DATABASE PROGRAM IING". Prepared and submitted by HALLIMATON SA'ADIAH BT.
SA'ADI as a particular fulfillment of the requit for the degree of Bachelor of Engineering with Honors of Electronics and Telecommunication is hereby approved
by :
DatC :" Z0
'O
11
Supervisor
P. KNIDMAT MAKLUMAT AKADEMIK UNIMAE
IIIIIIIIIIIIIIIIIIIIIIIIIIIII
0000118365Thank you Allah... for giving me strength to finish this Proj
ii
ACKNOWLEDGEMENT
Firstly, I would like to tank God for blessing me with a good health in the process of finishing this project.
I was really indebted to my supervisor for his kindly supervision and assistance during the preparation of this final year project. Here I would like to thank my
supervisor, Mr. Martin Anyi for sharing the ideas and guidance for me.
I also like to express my gratitude to my family members especially my father, mother, brothers and sisters who continually supported me.
Finally, I would like to thank all my friends for sharing their ideas and wonderful
moment with me.
iii
TABLES OF CONTENTS
CONTENT
DEDICATION
ACKNOWLEDGEMENT TABLES OF CONTENTS LIST OF TABLES
LIST OF FIGURES ABSTRACT
ABSTRAK
CHAPTER I: INTRODUCTION 1.0 Objectives and Purposes
1.1 What is a Smart Card
1.2 Development History of Smart Card 1.3 Smart Card Categories
1.3.1 Integrated Circuit (IC ) Microprocessor 1.3.2 Integrated Circuit (IC ) Memory Cards 1.3.3 Optical Memory Cards
1.4 Chip Comparisons 1.5 Types of Smart Card
1.5.1 Contact Smart Cards
1.5.2 Contact - less Smart Cards
PAGE
iv viii
ix
xi
ani
1 2
3 3 4
5
5
6
6 7
7
iv
1.6 The Micromodule
1.7 Micromodule Components
1.8 Comparisons with Magnetic Stripe Card 1.9 The Reasons of Using Smart Card
1.10 Advantages of Smart Cards
CHAPTER 2: LITERATURE REVIEW 2.0 What is Database
2.1 What is Database System?
2.1.1 Data
2.1.2 Hardware 2.1.3 Software 2.1.4 Users
2.2 Microsoft Access Database 2.3 The Many Faces of Access
2.4 What is in an Access Database File 2.5 Designing the Database
2.6 The Database File in Access 2.7 Compacting a Database
2.8 Developing Applications in Access
2.9 Installing Requirement and data Capacity 2.10 Primary Key
8 9
11 11 11
13 13 14 15
15 16 16 17 18 18 19 20
20
21 22
V
CHAPTER 3: DATABASE PROTOCOL 3.0 Data Access Objects ( DAO )
3.1 Data Controls
3.2 Remote Data Objects ( RDO ) 3.3 ActiveX Data Objects
3.4 OLE DB
3.5 Data Bound Controls 3.6 ODBC Drivers
CHAPTER 4: THE SOFTWARES FOR THE PROJECTS 4.0 Microsoft Access
4.0.1 Tables
4.1 Visual Basic Programming 4.1.1 Visual Basic Editions 4.2 ZC Basic Programming
23 25 25 26
27
27 28
29 30
32
34
35
CHAPTER 5: THE LINKING PROCESS BETWEEN THE DATABASE AND GUI
5.0 The Database 37
5.1 The Linking Process Between the Database and GUI 38
5.2 Properties of Data Control 39
5.3 Properties of Data Bound Control 42
vi
CHAPTER 6: SMART CARD DATABASE MECHANISM 6.0 Software Development
6.1 Features of the Program 6.2 Data Files
6.3 Adjust the Terminal Time RECOMMENDATION
CONCLUSION APPENDIX A
APPENDIX B
RERERENCES
44
46 49
50
51
53
54
70 81
V11
LIST OF TABLES
TABLES PAGE
1.0 Smart Card Chip Comparison 5
2.1 Data Types for Access Database 21
V111
LIST OF FIGURES
FIGURE PAGE
Figure 1.0 Microprocessor Smart Card 4
Figure 1.1 Types of Smart Card 6
Figure 1.2 Contact Smart Card 7
Figure 1.3 Contactless Smart Card 8
Figure 1.4 The Micromodule 9
Figure 2.0 Simplified Picture of a Database System 14
Figure 3.0 DAO Database Environment 24
Figure 3.1 The OLE DB Architecture 27
Figure 4.0 An Access Table in Datasheet View 31 Figure 4.1 The Design View of Employee Database 31
Figure 5.0 Employees Database 37
Figure 5.1 The Design View of Employee Database 38 Figure 5.2 The Controls Bounds in the Form to a Database Table 39
Figure 5.3 Set the Properties for a Data Control in the Properties Windows 40 Figure 5.4 Set the Connect Property to the Type of Database 40
Figure 5.5 Select the Database File in the DatabaseNanie Dialog Box 41 Figure 5.6 Select the Table Name for the RecordSource Property 41 Figure 5.7 Select the Name of the Data Control for the Data - Bound
Control's DataSource Property. 42
ix
Figure 6.0 The Flowchart of the Mechanism of ID Detection from the
Smart Card 45
Figure 6.1 The Interface for the Punch Card Purpose 46 Figure 6.2 Interface for Viewing Employees Information 47 Figure 6.3 Conformation Message for Deleting Employees File 47 Figure 6.4 The Display of the Calculate Working Hours and Salaries 48
Figure 6.5 The Sequential File 49
X
ABSTRACT
Smart Card becomes the necessity of modern lifestyle. As the project concern with the development of the smart card database system, the main objective of this project is to store personal employee data in Microsoft Access and Graphic User Interface (GUI) using Visual Basic 6.0 programming and process the displayed data.
The software used to run the project are Microsoft Access for the database, Visual Basic 6.0 for the interface and ZCBasic to store data in the smart card. The software program will use to record the employee data and working hours. The program also able to read the employees ID number in the smart card and allow the employee to record their attendance everyday. The program was designed in such way it is available for both employee and administration
xi
ABSTRAK
Smart Card adalah satu kemestian dalam care hidup modes. Projek ini adalah berkenaan tentang pembinaan system pangkalan data bagi smart card den objektif utamanya adalah untuk menghasilkan pangkalan data bagi menyimpan maklumat pekerja dan diakses menggunakan amtara muka ( graphic user interface ) dihasilkrm menggunakan perisian Visual Basic 6.0 dan turut memproses data yang ipaparkan.
Perisian yang digunakan untuk menjalankan projek ini ialah Microsoft Access untuk menghasilkan pangkalan data, Visual Basic 6.0 untuk antara muka den pemprogaman ZC Basic untuk menyimpan data di dalam smart c ard. Program perisian yang dihasilkan adalah untuk data peribadi pekerja den mass bekerja.
Program im mampu membaca data berupa nombor ID pekerja di dalam smart card dan ini bertujuan untuk merekodkan mass masuk dan mass tamat pekerjaan setup hari. Penghasilan program ini adalah untuk kegunaan pekerja dan pihak pengurusan.
X11
CHAPTER 1
INTRODUCTION
A smart card -a type of chip card - is a plastic card embedded with a computer chip that stores and transacts data between users. This data is associated with either value or information or both and is stored and processed within the card's chip, either a
memory or microprocessor. The card is transacted via a reader that is a part of computing system.
1.0 Objectives and Purposes
The goals of this project are :
1) Create a program
This project is to create employees database using Microsoft Access and GUI in Visual Basic 6.0
2) Linking the Database and GUI
The database and GUI is done separately by linking the GUI and the database, user can view and changing the information in the database using the interface instead of going directly open the database.
1
3) Display and manipulate the data.
The time when employee punch in and punch out will be record inn sequential file. From here the data will be retrieve in the interface and manipulate it to calculate total working hours and salary.
4) Besides reading the data programmed in Access, the GUI is to read aid display data programmed in a smart card.
The data in the smart card contains the employee ID that will be use to record the time without doing it manually.
1.1 What is a Smart Card?
The term Smart Card is loosely to describe any card with capability to relate information to particular application such as magnetic stripe, optical, memory and microprocessor card. It is more precise, however to refer to memory and microprocessor card as smart cards.
A smart card is a card that is embedded with either a microprocessor and a memory chip or only a memory chip with non - programmable logic. The microprocessor can add, delete and otherwise manipulate information on the casrd, while a memory - chip card ( for example, pre paid phone card ) can only undertake a pre - defined
operation.
2
1.2 Developmest History of Smart Card.
1974 - Roland Moreno in France acquired IC Card Patent - Established Innovation Co.
1979 - BULL developed CP8 SPOM Card.
1983 - Telecom France applied Smart Card to Phone Card and MiniTel.
1986 - France adopted Smart Card as a standard off- line Credit Card 1986 - Established ISO 7816 -1
1988 - Financial Organization in France issued Credit Card 1989 - Adopted GSM SIM IC Card
1991 - Started standardization of EUROPAY, MASTERCARD, VISA : EMV
1992 - Finland Electronic Purse - AVANT, Denmark Electronic Purse DANMONT.
1993 - UK Electronic Money : MONDEX.
1994 - Belgium : PROTON
1996 - Started common standardization of PC/SC
1996 - Cyberflex Card of 32 - bit Smart Card ( Schlumberger Co. )
1998 - Bus & Subway Cards in Seoul, Hanaro Bus & Subway Cards in Pusan
1.3 Smart Card Categories
Today, there are three categories of smart cards, all of which are evolving rapidly into new markets and applications.
3
1.3.1 Integrated Circuit (IC) Microprocessor Card
The microprocessor type of Smart Card defined as an IC chip contact card with a microprocessor and memory. Microprocessor cards also generally referred to by the industry as "chip cards" offer greater memory storage and security of data than a traditional magnetic stripe card. No bigger than a credit card, this smart card contains a dime - size microchip that can be process and store thousand of bits of electronic data. The current generation of chip cards has an eight - bit processor,
16KB read - only memory, and 512 bytes of random - access memory. This gives them the equivalent processing power of the original IBM - XT computer, albeit with slightly less memory capacity.
Figure 1.0 Microprocessor Smart Card.
These cards are used for variety applications, especially those that have cryptography built in, which requires manipulation of large numbers. Thus, chip cards have been the main platform for cards that hold a secure digital identity. Some examples of these cards are :
" Cards that hold money ("stored value cards")
" Card that hold money equivalents ( for example, affinity card ) 4
" Cards that provide secure access to a network
" Cards that secure cellular phones from f and
" Cards that allow set - top boxes on televisions to remain secure from
piracy
1.3.2 Integrated Circuit ( IC ) Memory Cards
IC memory cards can hold up to 1- 4 KB of data, but have no processor on the card with which to manipulate that data. Thus, they are dependent on the card reader (also known as the card - accepting device) for the processing and are suitable for uses where the cards perform fixed operation
Memory cards use in disposable - card applications like pre - paid phone cards.
Memory cards are popular as high - security alternatives to magnetic stripe cards
1.3.3 Optical Memory Cards
Optical memory cards look like a card with a piece of CD glued on top - which is basically what they are. Optical memory cards can store up to 4MB of data. But once written, the data cannot be changed or removed. Thus, this type of card is ideal for record keeping - for example medical files, driving records, or travel histories.
Today, these cards have no processor in them (although this is coming in near future). While the cards are comparable in price to chip cards, the card readers use non - standard protocols and are expensive.
5
1.4 Smart Card Chip Comparisons
.. -ý-
mmha reweesa6t
mm r.. K
CVQCfty
Cost
ofCut
4fRwAwCats a i CaaeeWot
Iiia. ýir Sen}. 140 bye.. ltoes. so90
- t750
Cu*
w. 7s
b, bgraYi cäsWl 1 Kbyt. Nad. f1- SIJO m
Mo=wy Cv? b
bNograbd Cb+edt 8 Kbytst S-bri cps. aowq to S7415
ha. +awa Gei 16- and 32-tat
Opßeat ýý7' 49 Mýytýý Nosý Gei
aDuriD1: Gartner ßnDttp
1.5 Types of Smart Cards
ýý
® HYBRID
Cata
COWIACTI U$
CARD
® CCºMTACT CAAD
ý
W COM. I CA»
1_
i
n. s12
s3r900- Aooo
® ýr
uaýE a
ý ýann
I wRCT CARý
® dtYºTO CARD
I
6
1.5.1 Contact Smart Cards
Card body
dlodute icontacts
sasrrca. Gmpkat : `+i; aav. a :: "". ."
Figure 1.2 Contact Smart Card
Contact Cards require insertion into a smart card reader with a direct connection to conductive micro - module on the surface of the card. The connection between the
IC on the card and the card reader (today all readers can also write) is done through mechanical contacts. Smart card ICs are packaged in specialized "module" that protect the silicon (i. e the IC) from mechanical stress and allow metal contacts, planar to the card surface, to connect to the pads on the silicon. In the manufacturing process the module is glued into a cavity that has been milled into the plastic card.
The majority of cards are contact cards where the contact location (6 or 8) are standardized (IS07816), one of the few true standards in the industry.
1.5.2 Contactless Smart Card
Contactless Cards require only close proximity (a few inches) of a reader. The IC in the card communicats vie electromagnetic fields with the reader using an antenna that inserted in the card. The antenna is connected with a specialized module that
7
encapsulates the IC. Contactless cards usually cannot be identified from the outside as such. All the "smarts" are hidden inside. The two main frequencies used are
125KHz and 13.6 MHz. The latter being the more recent technology.
Card body (back)
A ntWM
"uct Gemylus Pi a x+t ý; rýit K CiMs
Figure 1.3 Contactless Smart Card
1.6 The Micromodule
Smart cards are credit card - sized, often made of flexible plastic (polyvinyl chloride or PVC), and are embedded with a micromodule containing a single silicon
integrated circuit chip with memory and microprocessor. The micromodule has eight metallic pads on its surface, each designed to international standards for VCC (poer supply volatage), RST (used to reset the microprocessor on the smart card), CLK (clock signal), GND (ground), VPP ( programming or write voltage), and 1/0 (serial input/output line). Two pads are reserved for future use (RFU). Only the 1/o and GND contacts are mandatory on a card to meet international standards; others are optional.
8
When a smart card is inserted into a Card Acceptance Device or CAD (such as a point - of - sale terminal), the metallic pads come into contact with the CAD's corresponding metallic pins, thereby allowing the card and CAD to communicate.
Smart cards are always reset when they are inserted into a CAD. This action causes the smart card to respond by sending as "Answer - to - Reset" (ATR) message, which informs the CAD, what rules govern communication with the card and the processing of a transaction.
Micro*xu&lc Top View Iiicnxtodde SW Vim
Figure 1.4 The Micromodule
1.7 Micromodule Components.
The micromodule on board the smart card is made up of certain key components that allow it to execute instructions supporting the card's functionality.
The Microprocessor Unit (MPU) executes programmed instructions. Typically older version smart cards are based on relatively slow, 8- bit embedded microcontrollers.
9
Me trend during the 1990s has been toward using customized controllers with a 32- bit Reduced Instruction set Computing (RISC) processor running at 25 to 32MHz.
The I/O Controller manages the flow of data between the Card Acceptance Device (CAD) and the microprocessor.
Read Only Memory (ROM) of Program Memory is where the instruction are permanently burned into memory by the silicon manufacturer. These instructions (such as when the power supply is activated and the program that manages the password) are the fundamentals of the Chip Operating System (COS) or, as often called the "Mask".
Random Access Memory (RAM) or Working Memory serves as the temporary storage of results from calculation or input/output communications. RAM is a volatile memory and losses information immediately when the power supply is switched off.
Application Memory, which today is almost double E-PROM (Electrically Erasable Programmable Read - Only Memory) can be erased electronically and rewritten. By international standards, this memory should retain data for up to 10 years without electrical power and should support at least 10,000 read-write actions during the life of the card. Applications memory is used by executing application to store
information on the card.
10