courier services

101
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 DHANANJAI SINGH PROJECT GUIDE R.NO.: 9357028 BCA-VI SEM. 1 | Page

Upload: captureadil27318150

Post on 01-Nov-2014

59 views

Category:

Documents


3 download

DESCRIPTION

Computer Based Courier System

TRANSCRIPT

Page 1: Courier Services

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 DHANANJAI SINGH PROJECT GUIDE R.NO.: 9357028

BCA-VI SEM.

INSTITUTE OF MANAGEMENT STUDIESC-238, BULANDSHAHAR G.T. ROAD, LAL QUAN, P.B. NO. 57,

GHAZIABAD-201009

1 | P a g e

Page 2: Courier Services

ACKNOWLEDGEMENT

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.

2 | P a g e

Page 3: Courier Services

INDEX

1. ACKNOWLEDGEMENT 2

2. CERTIFICATE OF ORIGINALITY

3. INTRODUCTION 4

4. HARDWARE REQUIREMENT

5. SOFWARE REQUIREMENT

6. INVESTIGATION INFORMATION REQUIRED

7. SOFTWARE DEVELOPMENT LIFE CYCLE

8. FORM & CODING

9. BIBLIOGRAPHY

3 | P a g e

Page 4: Courier Services

Introduction

4 | P a g e

Page 5: Courier Services

5 | P a g e

Page 6: Courier Services

INTRODUCTIONINTRODUCTION

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 MeaningD.I.M. Development of

the Intranet Module

S/W SoftwareH/W 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 )

6 | P a g e

Page 7: Courier Services

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

7 | P a g e

Page 8: Courier Services

System Features

8 | P a g e

Page 9: Courier Services

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.

9 | P a g e

Page 10: Courier Services

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.

10 | P a g e

Page 11: Courier Services

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.

11 | P a g e

Page 12: Courier Services

ExternalInterface

Requirements

12 | P a g e

Page 13: Courier Services

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

13 | P a g e

Page 14: Courier Services

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.

14 | P a g e

Page 15: Courier Services

OtherNonfunctionalRequirements

15 | P a g e

Page 16: Courier Services

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 won’t 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.

16 | P a g e

Page 17: Courier Services

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.

17 | P a g e

Page 18: Courier Services

Other Requirements

18 | P a g e

Page 19: Courier Services

6. Other Requirements

Till this time, any further requirement is not visible. If in case, the need arises, that’ll

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 this’ll not take any special requirements hence, could be

easily implemented if decided to do so.

19 | P a g e

Page 20: Courier Services

Design

20 | P a g e

Page 21: Courier Services

Database Design

Table Name: c_emp

Field Name Constraint Data TypeEmp_id Primary key Number(3)emp_name Varchar(15)emp_address Varchar(20)Emp_phone Number(11)

Table Name: emp_login

Field Name Constraint Data Typelogin_name Primary Key Varchar(8)login_password Varchar(10)designation Check Varchar(13)standby_password Varchar(10)emp_id Foreign Key Number(3)alias_name Varchar(8)alias_password Varchar(10)

Table Name: attendece

Field Name Constraint Data Typelogin_name Foreign key Varchar(8)Present Check Varchar(3)a_date Check Date

21 | P a g e

Page 22: Courier Services

Table Name: performance

Field Name Constraint Data Typelogin_name Foreign Key Varchar(8)p_date Datestandby_status Check Varchar(3)standby_time Datestandby_resume Datealias_name Varchar(8)alias_password Varchar(10)

Table Name: courier_details

Field Name Constraint Data Typecourier_id Primary Key Number(4)s_name Varchar(15)s_address Varchar(20)s_phone Number(11)r_name Varchar(15)r_address Varchar(20)r_phone Number(11)Updatable Check Varchar(3)Status Varchar(10)amount Number(3)emp_id Foreign key Number(3)

Table Name: calculation

Field Name Constraint Data Typedestination Primary Key Varchar(15)charge_per_gram Number(2)

Table Name: update_date

Field Name Constraint Data Typelogin_name Varchar(8)updated_date date

22 | P a g e

Page 23: Courier Services

DFDS

23 | P a g e

Administrator

Validate for login & password

Enter Login

And Password

emp_login

Page 24: Courier Services

24 | P a g e

Administrator Administrator

Attendence sheet

Create aliase

add Employee

Update calculation table

C_emp

attendence

performance

calculation

Page 25: Courier Services

25 | P a g e

Validate login & Password

emp_login

New Courier Entry

Update Courier

Delete Courier

Working Department

courier_details courier_details courier_details

Courier Information

Courier_details

Page 26: Courier Services

26 | P a g e

Validate login & Password

Update Courier

Courier Information

Courier_detailsCourier_details

emp_loginDispatching Department

Page 27: Courier Services

27 | P a g e

Validate Login & Password

EnquiryDepartment emp_login

About Charges About Employee

About Courier

calculationc_emp courier_details

Enter Login

& Password

Page 28: Courier Services

System Analysisand

Design

28 | P a g e

Page 29: Courier Services

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 it’s

heavy reliance on elaborate documentation as completion criteria, the waterfall model is

29 | P a g e

Page 30: Courier Services

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 model’s 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 model’s 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

model’s 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, we’ll 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,

30 | P a g e

Page 31: Courier Services

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 they’ve

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 isn’t 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

31 | P a g e

Page 32: Courier Services

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

32 | P a g e

Page 33: Courier Services

Formand

Coding

33 | P a g e

Page 34: Courier Services

34 | P a g e

Page 35: Courier Services

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

35 | P a g e

Page 36: Courier Services

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

36 | P a g e

Page 37: Courier Services

37 | P a g e

Page 38: Courier Services

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")

38 | P a g e

Page 39: Courier Services

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

39 | P a g e

Page 40: Courier Services

40 | P a g e

Page 41: Courier Services

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

41 | P a g e

Page 42: Courier Services

42 | P a g e

Page 43: Courier Services

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"

43 | P a g e

Page 44: Courier Services

'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"

44 | P a g e

Page 45: Courier Services

'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 = " & "'" &

45 | P a g e

Page 46: Courier Services

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

46 | P a g e

Page 47: Courier Services

47 | P a g e

Page 48: Courier Services

Private Sub Form_Load()

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

End Sub

48 | P a g e

Page 49: Courier Services

49 | P a g e

Page 50: Courier Services

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

50 | P a g e

Page 51: Courier Services

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

51 | P a g e

Page 52: Courier Services

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

52 | P a g e

Page 53: Courier Services

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

53 | P a g e

Page 54: Courier Services

54 | P a g e

Page 55: Courier Services

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

55 | P a g e

Page 56: Courier Services

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

56 | P a g e

Page 57: Courier Services

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

57 | P a g e

Page 58: Courier Services

58 | P a g e

Page 59: Courier Services

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

59 | P a g e

Page 60: Courier Services

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

60 | P a g e

Page 61: Courier Services

'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

61 | P a g e

Page 62: Courier Services

62 | P a g e

Page 63: Courier Services

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

63 | P a g e

Page 64: Courier Services

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

64 | P a g e

Page 65: Courier Services

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

65 | P a g e

Page 66: Courier Services

66 | P a g e

Page 67: Courier Services

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"

67 | P a g e

Page 68: Courier Services

'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

68 | P a g e

Page 69: Courier Services

69 | P a g e

Page 70: Courier Services

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

70 | P a g e

Page 71: Courier Services

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

71 | P a g e

Page 72: Courier Services

72 | P a g e

Page 73: Courier Services

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

73 | P a g e

Page 74: Courier Services

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

74 | P a g e

Page 75: Courier Services

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

75 | P a g e

Page 76: Courier Services

76 | P a g e

Page 77: Courier Services

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:

77 | P a g e

Page 78: Courier Services

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

'above is database connectivity

End Sub

Private Sub empty_field_for_calculation()

Text2.Text = ""

End Sub

78 | P a g e

Page 79: Courier Services

BIBLIOGRAPHY

Mastering Visual Basic 6

Author(s) : Evangelos Petroutsos

Publisher : BPB Publications

Software Engineering A Practitioner’s 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

79 | P a g e