You are on page 1of 79

A

PROJECT REPORT
ON

COURIER SERVICES
SUBMITTED IN THE PARTIAL FULFILLMENT OF THE
REQUIREMENT FOR THE AWARD OF THE DEGREE
OF
BACHELOR OF COMPUTER APPLICATION
(2003-2006)

SUBMITTED TO:

SUBMITTED BY:

MISS TARU VARSHNEY


PROJECT GUIDE

DHANANJAI SINGH
R.NO.: 9357028
BCA-VI SEM.

INSTITUTE OF MANAGEMENT
STUDIES

C-238, BULANDSHAHAR G.T. ROAD, LAL QUAN, P.B.


NO. 57,
GHAZIABAD-201009

ACKNOWLEDGMENT
A project always is a result of collaborative efforts. This one has been
especially so. I am indebted to many people who have made this
happen. It is the right time to speak out the word of thanks for them. I
sincerely admit that without their efforts & blessings, this project
would not have taken its presence.

I am also thank to Miss Taru Varshney ( Project Guide BCA) for her guided
us in this project idea.

I would like to express my simple words of respect & gratitude


imprinted deep in my heart to the in-charge, computer center, for
providing me the guidance & never ending support.

DHANANJAI SINGH
BCA-VI SEM.

INDEX
1. ACKNOWLEDGEMENT
2. CERTIFICATE OF ORIGINALITY
3. INTRODUCTION
4. HARDWARE REQUIREMENT
5. SOFWARE REQUIREMENT
6. INVESTIGATION INFORMATION REQUIRED
7. SOFTWARE DEVELOPMENT LIFE CYCLE
8. FORM & CODING
9. BIBLIOGRAPHY

Introduction

INTRODUCTION
PURPOSE :
The project on Intranet Module shall be a useful product for managing the courier
services within a organization. It facilitates the users to send the couriers to other person
and to receive from others.

SCOPE:
This project provides the facility to all users to send and receive the courier. They can also
update and delete the courier, and also get the information of the status of the courier.

DOCUMENT CONVENTIONS:
The conventions shall be used to design the system are given below in the
following table so that the user can easily understand the system -

Abbreviation
D.I.M.
S/W
H/W

Meaning
Development of
the Intranet
Module
Software
Hardware

INTENDED AUDIENCE AND READING SUGGESTIONS :The document is mainly meant for the following people which shall
involve to design this system and to make the system more
interactive :-

1) Prof. V.B. Dhavan (H.O.D.)


2) Prof. Sunil Pandey ( Chairperson)
3) Prof. Nishit Goel ( Project Incharge )

4) Project Members
The rest of the document have very less number of abbreviation and
easy to understand as it is written in simple English language. The
document

contain

mainly

description

of

product

,hardware

requirement system requirement etc . S/W requirement and hardware


requirement is mainly meant for Mr. Manish ( Lab Incharge ).
Description of features of system is mainly meant for Prof. Nishit
Goel and our team members.

PROJECT SCOPE :The scope of project shall be describe in following points:


1) BENEFITS :The main benefit of this project is that it facilitate user to communicate in a
faster manner in comparison of manual system. Through this system
the current status of the courier can be known easily whereas in
manual system it is a difficult task.

2) OBJECTIVE :To provide quick service without any delay.


REFERENCES :

Mastering in VB

Oracle Developer Guide by Ivan Bayross

Visual Basic 6 in 21 Days by Greg Perry

System Features

3. System Features
3.1 Administrator
3.2 Working
3.3 Dispatching
3.4 Enquiry
3.1 Administrator : This department have all right to provide or restrict to any department or employee to the
functionality of the project.

3.1.1 Add Employee:Only the administrator will add the employee information and provide the login id
and password when any new employee will recruite into the enterprise of the courier
services.
3.1.2 Create alias:The administrator will provide the aliase of password of the employee who want to
go on the leaves. This feature will provide the working by another employee in place of
regular employee without knowing their password.
3.1.3 Attendance Sheet :The presentation or absent of the employee will be handled by the administrator.
Any employee can not get their proxy attendance by the change of system date or any
other type.
3.1.4 Courier information:Administrator has the right to get any information about the courier at any time
without any permission of regarding department.
3.1.5 Employee information:-

The employee database can be updated by the administrator department and the
administrator can get the any information about the employee working status.
3.1.6 Update calculation table:Only the administrator have right to change the Calculation table as per the changes
in the transportation cost.
3.2 Working department:3.2.1 New courier entry:Only the working department will enter the information of the new courier into the
data base.
3.2.2 Update courier :The working department employee can change the information about the courier as
per the request of the user with in the fix time.
3.2.3 Delete Courier :
The working department employee can cancel the courier as per the request of the
user with in the fix time.

3.3 Dispatching department :3.3.1 Update courier:It updates the status of the courier where the courier is at the current time.
3.2.1

Courier information :The dispatching department employees can get the information of the courier.

3.4 Enquiry:3.4.1 Enquiry of Charges:This feature will facilitate to make calculation of the amount for sending a courier
on the basis of the destination, weight & rate/gm.
3.4.2 About Employee:Through this feature the employee can retrieve the information about the other
employees.
3.4.3 About Courier:When the user is needed the information about the courier then employee can tell the
current status of the courier by this feature.

External
Interface
Requirements

4. External User Interfaces


4.1. User Interface
Here, our the user interface of the proposed system shall be VB forms
containing Menu bars, Buttons, Keyboard Shortcuts, Check boxes, List boxes etc.
according to the requirement. User can use Mouse to click the button or choose
from the menu and Keyboard to enter the data.

4.2. Hardware Interfaces


This software product shall be run properly on IBM PC or any other PC the
minimum hardware requirement for this software product shall be 64 MB RAM, 10
GB or more secondary memory, CD ROM for installation of this product. This
software product shall use WINDOW 98 operating system for establish the
interface between software and hardware. The interfaces provided by the Windows
OS are sufficient. Oracle and VB also use same interfaces.

4.3. Software Interfaces


We shall uses the following software to design this product :

Microsoft VISUAL BASIC version 6.0 as programming language and as front


end

user interface.

ORACLE version as a data base.

WINDOW version 95/98 as an operating system.

MDAC (Microsoft Data Access Component) or ODBC (Open Data Base


Connectivity) to create an inter face between Microsoft VB and product ORACLE.

MDAC or ODBC is a S/W that acts as an interface between Oracle and VB forms. In
case of Intranet/LAN workstations, where same data is shared among many users,
global data area is used.
4.4. Communication Interfaces
Since our proposed system shall be net-enabled so, communication interface
is Required . Proposed system contains four sites working concurrently. In the
proposed system, single database which is common to all four sites will be available
on server and all sites will be attached to server actively. In case of intranetworking,
Windows NT protocols are already in use. In case of mailing to developers for
further query, Microsoft Outlook Express is by default used by the Windows OS.

Other
Nonfunctional
Requirements

5.

Other Nonfunctional Requirements

5.1. Performance Requirements


The performance requirements of this product shall be not very critical. The system
shall be perform efficiently at 64 MB RAM. The product could run also at 32 MB
RAM but to perform well it is necessary to require the above specified quantity of
RAM.

5.2. Safety Requirements


Our product is absolutely safe to use. Its usage wont provide any damage or any
type of loss to the systems already in use. Also the security model is prepared
regarding the safety of Database so that data is not lost in case of any damage to
the system.

5.3.Security Requirements
Security of the system shall definitely be maintained through the password system.
The system is devided in the four security module concern. These are administrator,
enquiry department, working department, dispatching department. Each and every
employee of every department will be authenticated with a login id and password.
Any employee can not change the system date to make proxy presentation of
yourself.

5.4.Software Quality Attributes


Our proposed system shall provide a automate softwere product for the different department of the courier company. The
system will be highly Adaptabile, Available, Portable.

The software product shall have the following software quality


attributes:
Adaptability:--since it shall be simple to use for any non computer background
user. This software product shall not required the acute knowledge of computers.
Availability: -- since this product shall use the S/W which are easily available and
runs under very nominal conditions.

Portability: -- this product shall perfectly portable since it shall easy to install this
product normally on any systems with minimum hardware and software
requirements.
Reusability: -- this product shall not for just single time useable. User shall reuse
this product many time as he or she wants.
Robustness: -- this product shall have less robustness .
Reliability: -- the reliability of this product shall be dependent upon maintenance of
the database.

Other
Requirements

6. Other Requirements
Till this time, any further requirement is not visible. If in case, the need arises, thatll
be specified afterwards.

Appendix A: Glossary
As this is just a single project and the terms and language used in this project are
easy to interpret, and the abbreviations have already been described . The need
of building a separate Glossary is not viewed.

Appendix B: Issue List


The pending decision is about User Documentation that in what form the help shall
be provided with the proposed system. It may require use of HTML pages if on-line
help is to be provided and thisll not take any special requirements hence, could be
easily implemented if decided to do so.

Design

Database Design
Table Name: c_emp
Field Name
Emp_id
emp_name
emp_address
Emp_phone

Constraint
Primary key

Data Type
Number(3)
Varchar(15)
Varchar(20)
Number(11)

Table Name: emp_login


Field Name
login_name
login_password
designation
standby_password
emp_id
alias_name
alias_password

Constraint
Primary Key
Check
Foreign Key

Data Type
Varchar(8)
Varchar(10)
Varchar(13)
Varchar(10)
Number(3)
Varchar(8)
Varchar(10)

Table Name: attendece


Field Name
login_name
Present
a_date

Constraint
Foreign key
Check
Check

Data Type
Varchar(8)
Varchar(3)
Date

Table Name: performance


Field Name
login_name
p_date
standby_status
standby_time
standby_resume
alias_name
alias_password

Constraint
Foreign Key
Check

Data Type
Varchar(8)
Date
Varchar(3)
Date
Date
Varchar(8)
Varchar(10)

Table Name: courier_details


Field Name
courier_id
s_name
s_address
s_phone
r_name
r_address
r_phone
Updatable
Status
amount
emp_id

Constraint
Primary Key

Check
Foreign key

Data Type
Number(4)
Varchar(15)
Varchar(20)
Number(11)
Varchar(15)
Varchar(20)
Number(11)
Varchar(3)
Varchar(10)
Number(3)
Number(3)

Table Name: calculation


Field Name
destination
charge_per_gram

Constraint
Primary Key

Data Type
Varchar(15)
Number(2)

Table Name: update_date


Field Name
login_name
updated_date

Constraint

Data Type
Varchar(8)
date

DFDS

Enter
Login
Administrator
And
Password

Validate for
login &
password

emp_login

add Employee

C_emp

Attendence
sheet

attendence

Administrator
Create aliase

performance

Update
calculation table

calculation

Courier
Informatio
n

Courier_details

Validate login &


Working
Department

Password

emp_login

New Courier
Entry

courier_details

Update
Courier

courier_details

Delete
Courier

courier_details

Validate login
& Password

Dispatching
Department

Update
Courier

emp_login

Courier
Information

Courier_details
Courier_details

Enter Login
Enquiry
Department

Validate Login &


Password

& Password

About Charges

About
Employee

calculation

c_emp

emp_login

About
Courier

courier_details

System Analysis
and
Design

SYSTEM DEVELOPMENT LIFE CYCLE


The System Development Life Cycle (SDLC), was developed because, historically,
many computer system were being delivered which did not satisfy user requirements, and
because those few projects that did satisfy user requirement were being developed over
budget or over time. The SDLC is a methodology that has been constructed to ensure that
systems are designed and implemented in a methodical, logical and step-by-step
approach. there are seven steps, known as phases, in the SDLC :

The Preliminary Investigation Phase

The Analysis Phase

The Design Phase

The Development Phase

The Implementation phase

The Maintenance Phase

Post Implementation Evaluation and Maintenance

Each phase of the SDLC creates a tangible product or deliverable. an important


components of the SDLC is that at each phase, a conscious decision is made to continue
development of the project, or to drop it. in the past, projects developed without the
guidance of the SDLC were continued well after common sense dictated that it made no
sense to proceed further. the deliverables act as milestones against which we can judge
the progress and continuing viability of the project.
The waterfall model represents the first significant attempts at formalizing the software
development process and as such is probably the most widely known of the life-cycle
models. This model is linear and original, and makes the questionable assumption that
each development phase can be completed largely in isolation. This has been recognized
to a certain extent in later variant of the waterfall model that shows a limited form of
iteration between stages, but essentially retains their strict chronology. Because of its
heavy reliance on elaborate documentation as completion criteria, the waterfall model is

suitable for tightly specified systems such as compilers or operating system but breaks
down when applied to highly interactive projects such as graphical end user applications.
The spiral model represents a considerable evolution of the waterfall model by offering
a risk driven approach that emphasizes the activities of prototyping and the evaluation of
alternatives against initial hypotheses. This model also recognizes the applicability of
existing development model to particular tasks and as such can accommodate them as
special cases of the spiral model. the spiral model considers the development process as a
number of successive progressions through each of the models stages, each time at a
greater level of elaboration, thus providing an incremental approach to both software
development and maintenance. This approach is graphically represented as a continuous
spiral traversal through each of the models stages. Another advantages over the waterfall
model is that depending on specific project objectives and constraints, and the outcome of
the risk analysis phase, different development approaches or particular combinations will
prove to be more suitable than others. Thus for any given application, not all of the
models stages will be equally important, followed in the same sequence, or iterated
through the same number of times. However, despite the fact that it represents a
significant improvement over the waterfall model, the spiral model does not adequately
address the sufficient emphasis on the problem domain or the behavioral aspects of
system development.
To understand the structure and working of the SDLC, well examine each phase in turn.
The Preliminary Investigation
The preliminary Investigation Phase may begin with a phone call from a customer, a
memorandum from a vice president to the Director of the system development, a letter
from a customer to discuss a perceived problem or deficiency, or a request for something
new in an existing system. The purpose of the preliminary Investigation is not to develop
a system, but to verify that a problem or deficiency really exist, or to pass judgment on
the new requirement. This phase is typically very short, usually not more then a day or
two for a big project, and in some instances it can be as little as two hours. The end result,

or deliverable, from the Preliminary investigation phase is either a willingness to proceed


further, or the decision to call it quits.
Design
The exceptional (or foolish) programmer might begin coding without a good design.
Programmers who do so may find themselves going back to modify piece of code theyve
already written as they move through the project with a good design, the likelihood of
this happening will be reduced dramatically. The end result is a program that will have in
the way it was intended, and will generally have with the shorter overall program
development time. Design in the SDLC encompasses many different elements. Here is a
list of the different components that are designed in the phase : G input G output G
Processing H Files by the end of the design phase, we would hope to hope to have a
format requirements statement for the program, and a rough sketch of what the user
interface will look like.
Most programs are designed by the output of the program. The reasoning here is that if
you know what the output of the program should be, you can determine the input needed
to produce that output more easily. Once you know both the output from, and the input to
the program, you can then determine what processing needs to be performed to convert
the input to output. You will also be in a position to consider what information needs to
be saved, and in what sort of file. While doing the output and input design, more
information will be available to add to the requirement statement. It also possible that a
first screen design will take shape and at the end of these designs, and a sketch will be
made of what the screen will like. At this stage of the SDLC it isnt necessary to discuss
the how of what the program will do, just to get the requirement down on paper.
Development
The Development Phase is in many ways the most exciting time of the SDLC. During
this phase, computer hardware is purchased and the software is developed. That means
that we actually start coding the program. In the development phase, examination and
reexamination of the requirement statement is needed to ensure that it is being followed

to the letter. Any deviations would usually have to be approved either by the project
leader or by the customer. The development phase can be split into two sections, that of
Prototyping and Production ready Application Creation. Protyping is the stage of the
development phase that produces a pseudo-complete application, which for all intents and
purpose appears to be a fully functional. Developers use this stage to demo the
application to the customer as another check that the final software solution answers the
problem posed. When they are given the OK from the customer, the final version code is
written into this shell to complete this phase.
Implementation
In the implementation phase, the project reaches fruition. After the development phase of
the SDLC is complete, the system is implemented. Any hardware that has been purchased
will be delivered and installed. Software, which was designed in phase 3, and
programmed in phase 4 of the SDLC, will be installed on any PCs that require it. Any
persons that will be using the program will also be trained during this phase of the SDLC.
The system development life cycle during the implementation phase, both the hardware
and the software is tested. Although the programmer will find fix many problems, almost
invariably, the user will uncover problems that the developer ha been unable to simulate.
This leads on the sixth and final stage.
Audit and Maintenance
Phase 6 of the SDLC is the Audit and Maintenance Phase. In this phase someone (usually
the client, but sometimes a third party such as an auditor) studies the implemented system
to ensure that it actually fulfills the requirement statement. Most important, the system
should have solved the problems or deficiency, or satisfied the desire that was identified
in phase 1 of the SDLC the preliminary investigation. More than a few programs and
systems have been fully developed that, for one reason or another, simply never met the
original requirements. The maintenance portion of this phase deals with any changes that
need to be made to the system. Changes are sometime the result of the system not
completely fulfilling its original requirements, but they could also be the result of
customer satisfaction. Sometimes the customer is so happy with what they have got that
they want more. Changes can also be forced upon the system because

Form
and
Coding

Dim objconn As ADODB.Connection


Dim objrs As Recordset
Dim date_value As Variant
Private Sub Form_Load()
Set objconn = New ADODB.Connection
With objconn
.Provider = "msdaora"
.ConnectionString = "user id=scott;password=tiger"
.Open
End With
On Error GoTo error_lable
Set objrs = New ADODB.Recordset
objrs.Open "select * from attendece", objconn, adOpenDynamic,
adLockOptimistic
Exit Sub
error_lable:
MsgBox " Not a correct login name ", 0, "alert"

'above is database connectivity


End Sub

Private Sub Command1_Click()


date_value = Format$(Now, "d - mmm - yy")
'On Error GoTo DeleteErr

commandstring = "insert into attendece values ( " & "'" &


T_login_name.Text & "'" & "," & "'yes'" & "," & "'" & date_value & "'" &
")"
With objconn
.Execute (commandstring)
End With
empty_text_fields 'call to procedure
Exit Sub
'DeleteErr:
' MsgBox Err.Description
End Sub
Private Sub empty_text_fields()
T_login_name.Text = ""
End Sub

Dim objconn As ADODB.Connection


Dim objrs As Recordset
Private Sub Command1_Click()
Set objconn = New ADODB.Connection
With objconn
.Provider = "msdaora"
.ConnectionString = "user id=scott;password=tiger"
.Open
End With
On Error GoTo error_lable
Set objrs = New ADODB.Recordset
objrs.Open "select login_name,alias_name,alias_password from emp_login"
& " where login_name = " & "'" & T_login_name.Text & "' ", objconn,
adOpenDynamic, adLockOptimistic
attach_textfields_to_tablefields 'call to procedure
Exit Sub

error_lable:
MsgBox " Not a correct login name ", 0, "alert"

'above is database connectivity


End Sub

Private Sub attach_textfields_to_tablefields()


T_login_name.Text = objrs("login_name")

Text1.Text = objrs("alias_name")
Text2.Text = objrs("alias_password")
End Sub
Private Sub Command2_Click()
On Error GoTo DeleteErr
commandstring = "update emp_login set alias_name = " & "'" &
Text1.Text & "'" & ",alias_password =" & "'" & Text2.Text & "'" & "where
login_name = " & "'" & T_login_name.Text & "'"
With objconn
.Execute (commandstring)
End With
empty_text_fields 'call to procedure
Exit Sub
DeleteErr:
MsgBox Err.Description
End Sub
Private Sub empty_text_fields()
T_login_name.Text = ""
Text1.Text = ""
Text2.Text = ""
End Sub

Private Sub Command1_Click()


If O_courier_info = True Then
w_dept1.Show
End If
If O_CREATE_ALIAS = True Then
ADY_CREATE_ALIAS.Show
End If
If O_ATTENDENCE_SHEET = True Then
ADY_ATTENDENCE_SHEET.Show
End If
If O_emp_info = True Then
ADY_EMP_INFO.Show
End If
If O_ADD_EMPLOYEE = True Then
ADY_EMP_new.Show
End If
If O_UPDATE_C_TABLE = True Then
ADY_UPDATE_CAL_TABLE.Show
End If
End Sub

Dim objconn As ADODB.Connection


Dim objrs As Recordset
Dim objrs1 As Recordset
Dim objrs2 As Recordset
Private Sub Command1_Click()
ADY_PERFORMANCE_EMP.Show
Unload Me
End Sub

Private Sub Command5_Click()


Set objconn = New ADODB.Connection
With objconn
.Provider = "msdaora"
.ConnectionString = "user id=scott;password=tiger"
.Open
End With
On Error GoTo error_lable
attach_textfields_to_emplogin_tablefields 'call to procedure
attach_textfields_to_empdetails_tablefields
attach_textfields_to_empattendence_tablefields
Exit Sub

error_lable:
MsgBox " Not a correct LOGIN NAME ", 0, "alert"

'above is database connectivity

End Sub

Private Sub Form_Load()


connectivity_for_date
End Sub
Private Sub connectivity_for_date()
Set objconn = New ADODB.Connection
With objconn
.Provider = "msdaora"
.ConnectionString = "user id=scott;password=tiger"
.Open
End With
'On Error GoTo error_lable
Set objrs = New ADODB.Recordset
objrs.Open "select * from update_date", objconn, adOpenDynamic,
adLockOptimistic
L_DATE.Caption = Format$(objrs("UPDATED_DATE"), "d - mmm - yy")
Exit Sub

'error_lable:
'

MsgBox " SYSTEM PROBLEM CONTACT ADMINISTRATOR

& MAKE DATE UPDATE ", 0, "alert"

'above is database connectivity

End Sub
Private Sub attach_textfields_to_emplogin_tablefields()
Set objrs = New ADODB.Recordset
objrs.Open "select * from emp_login " & " where login_name = " & "'" &
T_LOGIN_NAME.Text & "' ", objconn, adOpenDynamic,
adLockOptimistic
Text9.Text = objrs("designation")
Text8.Text = objrs("login_password")
Text5.Text = objrs("standby_password")
On Error GoTo err_alias
Text7.Text = objrs("alias_name")
Text6.Text = objrs("alias_password")
Exit Sub
err_alias:
MsgBox "ALIAS FOR USER DOESN'T EXIST", vbOKOnly
Text7.Text = ""
Text6.Text = ""
End Sub
Private Sub attach_textfields_to_empdetails_tablefields()
Set objrs1 = New ADODB.Recordset
objrs1.Open "select * from c_emp,emp_login where c_emp.emp_id =
emp_login.emp_id and emp_login.login_name = " & "'" &

T_LOGIN_NAME.Text & "' ", objconn, adOpenDynamic,


adLockOptimistic
Text4.Text = objrs1("emp_name")
Text11.Text = objrs1("emp_address")
Text10.Text = objrs1("emp_phone")
End Sub
Private Sub attach_textfields_to_empattendence_tablefields()
Set objrs2 = New ADODB.Recordset
objrs2.Open "select attendece.present from attendece,emp_login where
attendece.login_name = emp_login.emp_id and emp_login.login_name = "
& "'" & T_LOGIN_NAME.Text & "'", objconn, adOpenDynamic,
adLockOptimistic
'Text2.Text = objrs2("")
'Text3.Text = objrs2("")
End Sub

Private Sub Form_Load()


L_DATE.Caption = Format$(Now, "d - mmm - yy")
End Sub

Dim WithEvents adoPrimaryRS As Recordset


Dim mbChangedByCode As Boolean
Dim mvBookMark As Variant
Dim mbEditFlag As Boolean
Dim mbAddNewFlag As Boolean
Dim mbDataChanged As Boolean

Private Sub Form_Load()


Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open
"PROVIDER=MSDASQL;dsn=courier;uid=SCOTT;pwd=TIGER;"

Set adoPrimaryRS = New Recordset


adoPrimaryRS.Open "select
LOGIN_NAME,P_DATE,STANDBY_TIME,STANDBY_RESUME from
PERFORMANCE", db, adOpenStatic, adLockOptimistic

Set grdDataGrid.DataSource = adoPrimaryRS

mbDataChanged = False
End Sub

Private Sub Form_Resize()


On Error Resume Next
'This will resize the grid when the form is resized
grdDataGrid.Height = Me.ScaleHeight - 30 - picButtons.Height picStatBox.Height
lblStatus.Width = Me.Width - 1500
cmdNext.Left = lblStatus.Width + 700
cmdLast.Left = cmdNext.Left + 340
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)


If mbEditFlag Or mbAddNewFlag Then Exit Sub

Select Case KeyCode


Case vbKeyEscape
cmdClose_Click
Case vbKeyEnd
cmdLast_Click
Case vbKeyHome
cmdFirst_Click
Case vbKeyUp, vbKeyPageUp
If Shift = vbCtrlMask Then
cmdFirst_Click
Else
cmdPrevious_Click

End If
Case vbKeyDown, vbKeyPageDown
If Shift = vbCtrlMask Then
cmdLast_Click
Else
cmdNext_Click
End If
End Select
End Sub

Private Sub Form_Unload(Cancel As Integer)


Screen.MousePointer = vbDefault
End Sub

Private Sub adoPrimaryRS_MoveComplete(ByVal adReason As


ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As
ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
'This will display the current record position for this recordset
lblStatus.Caption = "Record: " & CStr(adoPrimaryRS.AbsolutePosition)
End Sub

Private Sub adoPrimaryRS_WillChangeRecord(ByVal adReason As


ADODB.EventReasonEnum, ByVal cRecords As Long, adStatus As
ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
'This is where you put validation code

Exit Sub

GoPrevError:
MsgBox Err.Description
End Sub

Private Sub SetButtons(bVal As Boolean)


cmdDelete.Visible = bVal
cmdClose.Visible = bVal
cmdRefresh.Visible = bVal
cmdNext.Enabled = bVal
cmdFirst.Enabled = bVal
cmdLast.Enabled = bVal
cmdPrevious.Enabled = bVal
End Sub

Dim WithEvents adoPrimaryRS As Recordset


Dim mbChangedByCode As Boolean
Dim mvBookMark As Variant
Dim mbEditFlag As Boolean
Dim mbAddNewFlag As Boolean
Dim mbDataChanged As Boolean

Private Sub Form_Load()


Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=MSDASQL;dsn=courier;uid=scott;pwd=TIGER;"

Set adoPrimaryRS = New Recordset


adoPrimaryRS.Open "select DESTINATION,CHARGE_PER_GRAM
from CALCULATION", db, adOpenStatic, adLockOptimistic

Dim oText As TextBox


'Bind the text boxes to the data provider
For Each oText In Me.txtFields
Set oText.DataSource = adoPrimaryRS
Next

mbDataChanged = False
End Sub

adoPrimaryRS.MoveFirst
mbDataChanged = False

Exit Sub

GoFirstError:
MsgBox Err.Description
End Sub

Private Sub cmdLast_Click()


On Error GoTo GoLastError

adoPrimaryRS.MoveLast
mbDataChanged = False

Exit Sub

GoLastError:
MsgBox Err.Description
End Sub

Private Sub cmdNext_Click()


On Error GoTo GoNextError

If Not adoPrimaryRS.EOF Then adoPrimaryRS.MoveNext

Exit Sub

GoPrevError:
MsgBox Err.Description
End Sub

Private Sub SetButtons(bVal As Boolean)


cmdAdd.Visible = bVal
cmdEdit.Visible = bVal
cmdUpdate.Visible = Not bVal
cmdCancel.Visible = Not bVal
cmdDelete.Visible = bVal
cmdClose.Visible = bVal
cmdNext.Enabled = bVal
cmdFirst.Enabled = bVal
cmdLast.Enabled = bVal
cmdPrevious.Enabled = bVal
End Sub

Dim objconn As ADODB.Connection


Dim objrs As Recordset
Private Sub Command1_Click()
ProgressBar1.Value = 0
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
ProgressBar1.Value = 0
End Sub
Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1.Value + 10
If ProgressBar1.Value >= 100 Then
Timer1.Enabled = False
If login.o_ady_emp.Value = True Then
updating_date_in_database ' this is done only when ady login
ady_dept1.Show
Unload login
Unload Me
End If
If login.o_d_emp.Value = True Then
d_dept1.Show
Unload login
Unload Me
End If

If login.o_w_emp.Value = True Then


w_dept1.Show
Unload login
Unload Me
End If
If login.o_e_emp.Value = True Then
e_dept1.Show
Unload login
Unload Me
End If
End If

End Sub

Private Sub updating_date_in_database()


login_value = login.T_LOGIN_NAME.Text
date_value = Format$(Now, "d - mmm - yy")
' above statement refresh the values like fflush() in c
Set objconn = New ADODB.Connection
With objconn
.Provider = "msdaora"
.ConnectionString = "user id=scott;password=tiger"
.Open
End With

'On Error GoTo error_lable


Set objrs = New ADODB.Recordset
objrs.Open "select * from update_date", objconn, adOpenDynamic,
adLockOptimistic
commandstring = "update update_date set login_name = " & "'" &
login_value & "'" & ",updated_date =" & "'" & date_value & "'"
objconn.Execute (commandstring)
Exit Sub

'error_lable:

End Sub

Dim reply As Variant


Dim objconn As ADODB.Connection
Dim WithEvents objrs As Recordset

Private Sub COLOR_OF_TEXTFIELD_TO_WHITE()


t_courier_id.BackColor = &H80000018
Text2.BackColor = &H80000018
Text3.BackColor = &H80000018
Text4.BackColor = &H80000018
Text5.BackColor = &H80000018
Text6.BackColor = &H80000018
Text7.BackColor = &H80000018
Text8.BackColor = &H80000018
Text9.BackColor = &H80000018
Text10.BackColor = &H80000018
End Sub
Private Sub ENABLE_THE_TEXTFIELD()
t_courier_id.Visible = True
t_courier_id.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True

End Sub
Private Sub empty_text_fields()
t_courier_id.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
End Sub
Private Sub connectivity_for_info()
Set objconn = New ADODB.Connection
With objconn
.Provider = "msdaora"
.ConnectionString = "user id=scott;password=tiger"
.Open
End With
On Error GoTo error_lable
Set objrs = New ADODB.Recordset
objrs.Open "select * from courier_details " & " where courier_id = " & "'" &
t_courier_id.Text & "' ", objconn, adOpenDynamic, adLockOptimistic
attach_textfields_to_tablefields 'call to procedure

Text4.Text = objrs("s_phone")
Text5.Text = objrs("r_name")
Text6.Text = objrs("r_address")
Text7.Text = objrs("r_phone")
Text8.Text = objrs("updatable")
Text9.Text = objrs("status")
Text10.Text = objrs("AMOUNT")
End Sub

Dim objconn As ADODB.Connection


Dim objrs As Recordset
Dim rate As Variant
Private Sub Command1_Click()
empty_field_for_employee
Set objconn = New ADODB.Connection
With objconn
.Provider = "msdaora"
.ConnectionString = "user id=scott;password=tiger"
.Open
End With
'On Error GoTo error_lable
Set objrs = New ADODB.Recordset
objrs.Open "select
c_emp.emp_id,c_emp.emp_name,c_emp.emp_address,emp_login.login_na
me,c_emp.emp_phone,attendece.present from c_emp,emp_login,attendece
where C_EMP.EMP_ID =" & "'" & T_EMP_ID.Text & "'" & " and
emp_login.emp_id = c_emp.emp_id and emp_login.login_name =
attendece.login_name", objconn, adOpenDynamic, adLockOptimistic
attach_textfields_to_tablefields_employee 'call to procedure
Exit Sub

'error_lable:
'

MsgBox " Not a correct EMPLOYEE ID ", 0, "alert"

'above is database connectivity


End Sub

Private Sub Command2_Click()


empty_field_for_calculation
If Text4.Text = "" Then
MsgBox "ENTER THE WEIGHT FOR COURIER", vbOKOnly
Exit Sub
End If
Set objconn = New ADODB.Connection
With objconn
.Provider = "msdaora"
.ConnectionString = "user id=scott;password=tiger"
.Open
End With
On Error GoTo error_lable
Set objrs = New ADODB.Recordset
objrs.Open "select * from calculation where destination = " & "'" &
Text1.Text & "'", objconn, adOpenDynamic, adLockOptimistic
objrs.MoveFirst
Text1.Text = objrs("destination")
rate = objrs("charge_per_gram")
Text2.Text = rate * Val(Text4.Text)
Exit Sub

Option Explicit
Dim objconn As ADODB.Connection
Dim objrs As ADODB.Recordset
Dim objconn1 As ADODB.Connection
Dim objrs1 As ADODB.Recordset
Dim date_value As Variant
Dim l_name As String
Dim l_password As String
Dim l_des As String
Dim l_name1 As String
Dim l_password1 As String
Dim l_des1 As String
Dim l_attendence As String 'this uses seprate connection and recordset
Dim o_des_value As String
Private Sub Command1_Click()
d_connection
d_connection_for_attendence
If l_attendence <> "yes" Then
If o_ady_emp.Value = False Then
Exit Sub
End If
End If
data_validation

End Sub

End With
On Error GoTo error_lable
Set objrs1 = New ADODB.Recordset
If o_ady_emp.Value = False Then ' not going to check attendence for
administrator
objrs1.Open "select * from attendece " & " where login_name = " & "'"
& T_login_name.Text & "'" & "and" & " a_date = " & "'" & date_value &
"'", objconn, adOpenDynamic, adLockOptimistic
End If
l_attendence = objrs1("present")
If o_ady_emp.Value = True Then
l_attendence = "yes" ' for administrator
End If
Exit Sub

error_lable:
If o_ady_emp.Value = True Then
l_attendence = "yes" ' for administrator
Else
MsgBox " CHECK WITH ADMINISTRATOR FOR UR
ATTENDENCE OR UR SYSTEM DATE IS NOT CORRECT", 0, "alert"
End If
End Sub

Dim objconn As ADODB.Connection


Dim WithEvents objrs As Recordset

Private Sub COLOR_OF_TEXTFIELD_TO_WHITE()


t_courier_id.BackColor = &H80000018
Text2.BackColor = &H80000018
Text3.BackColor = &H80000018
Text4.BackColor = &H80000018
Text5.BackColor = &H80000018
Text6.BackColor = &H80000018
Text7.BackColor = &H80000018
Text8.BackColor = &H80000018
Text9.BackColor = &H80000018
Text10.BackColor = &H80000018
End Sub
Private Sub ENABLE_THE_TEXTFIELD()
t_courier_id.Visible = True
t_courier_id.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True

ADD_RECORD

' procedure call

End If
COLOR_OF_TEXTFIELD_TO_BLACK
DISABLE_THE_TEXTFIELD
LOCK_THE_TEXTFIELD
empty_text_fields
C_NEXT.Visible = False
C_INFO.Visible = False
C_OK.Enabled = True
C_DELETE.Enabled = False
C_SUBMIT.Enabled = False
C_BACK.Enabled = False
O_DELETE_COURIER.Visible = True
O_NEW_COURIER.Visible = True
O_UPDATE_COURIER.Visible = True
O_INFO_COURIER.Visible = True
End If

End Sub
Private Sub C_DELETE_Click()
If O_DELETE_COURIER.Visible = True Then
reply = MsgBox("ARE YOU SURE YOU WANT TO DELETE???", 1,
"COFIRMING YOUR DELETE")
End If

MsgBox "Enter Amount less than 1000", vbOKOnly


End If
On Error GoTo AddErr
commandstring = "insert into courier_details values ( " & "'" &
t_courier_id.Text & "'" & "," & "'" & Text2.Text & "'" & "," & "'" &
Text3.Text & "'" & "," & "'" & Text4.Text & "'" & "," & "'" & Text5.Text &
"'" & "," & "'" & Text6.Text & "'" & "," & "'" & Text7.Text & "'" & "," & "'"
& Text8.Text & "'" & "," & "'" & Text9.Text & "'" & "," & "'" &
Text10.Text & "'" & "," & "'" & 1 & "'" & ")"
With objconn
.Execute (commandstring)
End With
Exit Sub
AddErr:
MsgBox "EITHER not a unique courier_id OR data is invalid", vbOKOnly
End Sub

Private Sub OPTION_ITEM_EXIT_Click()


Unload Me
End Sub

Dim rate As Variant

Private Sub Command2_Click()


empty_field_for_calculation
If Text4.Text = "" Then
MsgBox "ENTER THE WEIGHT FOR COURIER", vbOKOnly
Exit Sub
End If
Set objconn = New ADODB.Connection
With objconn
.Provider = "msdaora"
.ConnectionString = "user id=scott;password=tiger"
.Open
End With
On Error GoTo error_lable
Set objrs = New ADODB.Recordset
objrs.Open "select * from calculation where destination = " & "'" &
Text1.Text & "'", objconn, adOpenDynamic, adLockOptimistic
objrs.MoveFirst
Text1.Text = objrs("destination")
rate = objrs("charge_per_gram")
Text2.Text = rate * Val(Text4.Text)
Exit Sub

error_lable:

MsgBox " No Such Destination", 0, "alert"

'above is database connectivity


End Sub
Private Sub empty_field_for_calculation()
Text2.Text = ""
End Sub

BIBLIOGRAPHY
Mastering Visual Basic 6
Author(s) : Evangelos Petroutsos
Publisher : BPB Publications
Software Engineering A Practitioners Approach (fifth edition)
Author(s) : Roger S. Pressman
Publisher : Tata McGraw-Hill
Fundamentals Of Software Engineering
Author(s) : Carlo Ghezzi, Mehdi Jazayeri, and Dino Mandrioli
Publisher : Prentice Hall of India

You might also like