You are on page 1of 61

1

INTRODUCTION
Proposed “Railway Reservation System” is developed for to automate the railway
reservation system. It includes modules required to successfully operate railway reversion
process smoothly. It has train master to add modify train information, Train schedule to enter
train journey details include all the station name, arrival time and departure time. It includes
automatic fare calculation as per the distance between two stations.
Reservation module consist of automatic seat no and coach no allocation system. Daily
schedule for updation of not confirm seat and coach no. All master like train master, train
schedule, reservation fees, cancellation fees charges can be modified individually from front
end and changes reflect in all modules immediately.
Therefore proposed “Railway Reservation System” has been designed to automate the
process of railway for ticket reservation and back office activities. System can make the daily
activities efficient and providing the fast response.
Railway Reservation System – Modules
Security module - Security modules include security features like user management and
application level password management.
 Maintain user master- Each user identified by the user name and user type. Only
admin user can create, edit user information.
 Password must be 6 characters long.
 Password must be alpha numeric.
 While creating user system assign default password for the user, user must change
default password for first time login.
 All login time stamp stored in the system for security audit.
 Access level and roles and privileges are set for different type of users.
Master Management module - Master management module includes following sub
modules.

 Station Master – Every station is uniquely identified by system generated Station ID.
It also includes station code, station name and railway division name.


2
 Train Master – Every train uniquely identified by train no, it includes train name,
train schedule which days of the week train will run. No of coaches available for 3 tier
AC, First Class, Slipper Class etc.
 Train Schedule – It includes train journey details from start station to end station, all
in between station, distances between 2 station, arrival and departure time.
 Fare Rule – It help to calculate fare by distance, support different type of fare
calculation for different class like AC1, AC3 etc.
 Cancellation Fees Rule - It provide the master data for all ticket cancellation fees
calculation.
 Reservation and Super Fast Fees – It provide the master data for all ticket
cancellation fees calculation.
Transaction Module - Transaction module includes following sub modules.

 Reservation – This module used to make reservation, it asks for input data like train
no, journey date, from station code, end station code. System has powerful validation
rule to check validation like journey date must be greeter than system date, journey
date must be within 90 days. Train should run for the selected day. Check for from
station and to station. Seat availability, While saving the record system generate PRN
no, seat no and coach no. Before save the system ask for final confirmation. System
automatically calculates the fare and save the details.
 Cancellation – For cancellation of ticket it ask for PRN no, after entering the correct
PRN no system check for validity of the PRN no, whether it already cancelled,
journey date already expired. I it validate system display all the details of the
reservation. System automatically calculates the cancellation fees from the
cancellation rule master. Before save the record system ask for the confirmation.
 Update Seat no for unconfirmed passenger – It is schedule activity, system query
for all cancelled ticket for particular journey date and allocates all vacant seat to
unconfirmed passenger.
 Daily Cash Transaction – It shows daily transaction, like how much money received
and how much money refund. All data can be exported to MS Excel for review and
save in file system.



3
Query Module - A powerful query module give on screen information for particular PRN
NO, it shows all the reservation details and cancellation details, include current status for the
seat no, coach no.

Railway Reservation System – Advantages
 Complete end to end system for all the activities related to railway reservation system.
 Supports the full life cycle of ticket reservation, seat allocation, and ticket
cancellation. Reschedule the cancel seat to unconfirmed passenger.
 It is a scalable system.
 Has a clearly arranged and user-friendly interface
 Easy to use and minimum data entry, all important details is mater driven and provide
in drop down list to make fast operation and avoid mistake.
 Automatic fare calculation from stage master, in new updation of fare in stage master
will automatically reflect in all new reservation.
 All important details can be updated by front end master module only.
 Retrieval of forgotten passwords.
 Integrated security features.











4





PROBLEM DEFINITION















5



Problem definition
Existing system
In the existing system the exams are done only manually and proposed system we have to
computerize all the exams using this software.
The whole process of assigning test and evaluating their scores after the test ,was done
manually till date. Processing the test paper i.e. checking and distributing respective scores
used to take time when the software was not installed.

















6










SYSTEM ANALYSIS
AND
FEASIBILITY STUDY







7
SYSTEM ANALYSIS
Introduction to System Analysis
System analysis is a process of gathering and interpreting
facts, diagnosing problems and the information to recommend improvements on the
system. It is a problem solving activity that requires intensive communication
between the system users and system developers. System analysis or study is an
important phase of any system development process. The system is studied to the
minutest detail and analyzed. The system analyst plays the role of the interrogator and
dwells deep into the working of the present system. The system is viewed as a whole
and the input to the system are identified. The outputs from the organizations are
traced to the various processes. System analysis is concerned with becoming aware of
the problem, identifying the relevant and decisional variables, analyzing and
synthesizing the various factors and determining an optimal or at least a satisfactory
solution or program of action.
A detailed study of the process must be made by various
techniques like interviews, questionnaires etc. The data collected by these sources
must be scrutinized to arrive to a conclusion. The conclusion is an understanding of
how the system functions. This system is called the existing system. Now the existing
system is subjected to close study and problem areas are identified. The designer now
functions as a problem solver and tries to sort out the difficulties that the enterprise
faces. The solutions are given as proposals. The proposal is then weighed with the
existing system analytically and the best one is selected. The proposal is presented to
the user for an endorsement by the user. The proposal is reviewed on user request and
suitable changes are made. This is loop that ends as soon as the user is satisfied with
proposal.
Preliminary study is the process of gathering and interpreting facts, using the
information for further studies on the system. Preliminary study is problem solving
activity that requires intensive communication between the system users and system
developers. It does various feasibility studies. In these studies a rough figure of the
system activities can be obtained, from which the decision about the strategies to be
followed for effective system study and analysis can be take



8
FEASIBILITY STUDY
Feasibility study is made to see if the project on completion
will serve the purpose of the organization for the amount of work, effort and
the time that spend on it. Feasibility study lets the developer foresee the future
of the project and the usefulness. A feasibility study of a system proposal is
according to its workability, which is the impact on the organization, ability to
meet their user needs and effective use of resources. Thus when a new
application is proposed it normally goes through a feasibility study before it is
approved for development. The document provide the feasibility of the
project that is being designed and lists various areas that were considered very
carefully during the feasibility study of this project such as Technical,
Economic and Operational feasibilities. The following are its features:
TECHNICAL FEASIBILITY
The system must be evaluated from the technical point of view first. The
assessment of this feasibility must be based on an outline design of the system
requirement in the terms of input, output, programs and procedures. Having
identified an outline system, the investigation must go on to suggest the type
of equipment, required method developing the system, of running the system
once it has been designed.
Technical issues raised during the investigation are:

 Does the existing technology sufficient for the suggested one?
 Can the system expand if developed?

The project should be developed such that the necessary functions and performance
are achieved within the constraints. The project is developed within latest technology.
Through the technology may become obsolete after some period of time, due to the
fact that never version of same software supports older versions, the system may still
be used. So there are minimal constraints involved with this project. The system has
been developed using Java the project is technically feasible for development.


9

ECONOMIC FEASIBILITY
The developing system must be justified by cost and benefit. Criteria to ensure that
effort is concentrated on project, which will give best, return at the earliest. One of the
factors, which affect the development of a new system, is the cost it would require.
The following are some of the important financial questions asked during preliminary
investigation:

 The costs conduct a full system investigation.
 The cost of the hardware and software.
 The benefits in the form of reduced costs or fewer costly errors.

Since the system is developed as part of project work, there is no manual cost
to spend for the proposed system. Also all the resources are already available,
it give an indication of the system is economically possible for development.
BEHAVIORAL FEASIBILITY
This includes the following questions:
Is there sufficient support for the users?
Will the proposed system cause harm?
The project would be beneficial because it satisfies the objectives when developed
and installed. All behavioral aspects are considered carefully and conclude that the
project is behaviorally feasible.







10











SCOPE OF PROPOSED SYSTEM











11

Scope of Proposed system
The aim of proposed system is to develop a system of improved facilities. The
proposed system can overcome all the limitations of the existing system. The system
provides proper security and reduces the manual work.

 Security of data.
 Ensure data accuracy’s.
 Proper control of the higher officials.
 Minimize manual data entry.
 Minimum time needed for the various processing.
 Greater efficiency.
 Better service.
 User friendliness and interactive.
 Minimum time required.














12









System Requirement















13
System Requirement


Hard ware Requirements

Processor : X86 Compatible processor
with 1.7 GHz Clock speed

RAM : 512 MB or more

Hard disk : 20 GB or more

Monitor : VGA/SVGA

Keyboard : 104 Keys

Mouse : 2 buttons/ 3 buttons


Software Requirements

Operating System : Windows 2000/XP
Front end : Visual Basic 6.0
Back end : Ms-Access 2003/07








14



Front end














15

Microsoft Visual Basic 6.0

Visual Basic 6.0 is Microsoft’s latest version of the Visual Basic Programming language.
Although writing programs can be a tedious chore at time. Visual Basic reduces the effort
required on your part, and makes programming enjoyable. Visual Basic makes many aspects
of programming as simple as dragging graphics objects on to screen with your mouse.
Visual Basic 6.0 is more than just a programming language; the secret to Visual Basic is in its
name” Visual”. With to days Windows Operating System, a program must be able to interact
with the screen. Keyboard , mouse and printer graphically.
The environment provided by Visual Basic is suitable for any type of application. Using this
environment, the user can visually design the objects that your application uses. Visual Basic
is not just a languages, it’s an integrated development environment in which you can develop,
run, test and debug your applications. The impressive array of programming resources
provided by Visual Basic enables to create the objects extemporaneously which can range
from pop-up menu to a message box.
A form is a major part of Visual Basic application, which allows the user to enter the data as
well as view the result. A control is an object that we draw on a form to enable or enhance
user interaction with an application. Hence a Visual Basic application is a combination of
object like forms and controls, procedures that can respond to Events and other general-
purpose procedures.










16





Backend



















17
Microsoft Office Access 2007
Microsoft Office Access, previously known as Microsoft Access, is a relational database
management system from Microsoft that combines the relational Microsoft Jet Database
Engine with a graphical user interface and software-development tools. It is a member of the
Microsoft Office suite of applications, included in the Professional and higher editions or sold
separately. In mid-May 2010, the current version of Microsoft Access 2010 was released by
Microsoft in Office 2010; Microsoft Office Access 2007 was the prior version.
Access stores data in its own format based on the Access Jet Database Engine. It can also
import or link directly to data stored in other applications and databases.
[1]

Software developers and data architects can use Microsoft Access to develop application
software, and "power users" can use it to build simple applications. Like other Office
applications, Access is supported by Visual Basic for Applications, an object-oriented
programming language that can reference a variety of objects including DAO (Data Access
Objects), ActiveX Data Objects, and many other ActiveX components. Visual objects used in
forms and reports expose their methods and properties in the VBA programming
environment, and VBA code modules may declare and call Windows operating-system
functions.
 Access now includes support for a broader range of data types, including documents
and images.
 Whenever any table is updated, all reports referencing the table are also updated.
 Dropdown lists for a table can be modified in place.
 Lookup Fields, which get their values by "looking up" some value in a table, have
been updated to support multi valued lookups.
 Many new preset schemata are included.
 Access can synchronize with Windows SharePoint Services 3.0 and Office SharePoint
Server 2007. This feature enables a user to use Access reports while using a server-
based, backed-up, IT managed version of the data.









18





System Logical Design









19
DATA FLOW DIAGRAM
A Data Flow Diagram (DFD) is a diagram that describes the flow of
data and the processes that change or transform data throughout a system. It’s a structured
analysis and design tool that can be used for flowcharting in place of, or in association with,
information oriented and process oriented system flowcharts. When analysts prepare the Data
Flow Diagram, they specify the user needs at a level of detail that virtually determines the
information flow into and out of the system and the required data resources. This network is
constructed by using a set of symbols that do not imply a physical implementation. The Data
Flow Diagram reviews the current physical system, prepares input and output specification,
specifies the implementation plan etc.
Four basic symbols are used to construct data flow diagrams. They are
symbols that represent data source, data flows, and data transformations and data storage. The
points at which data are transformed are represented by enclosed figures, usually circles,
which are called nodes.

Data Flow Diagram Symbols:-
_ Source or Destination of data
_ Data Flow

_ Process

_ Storage


20


ents


21
Data dictionary
A data dictionary is a structured repository of data about data. It is a set of rigorous
definitions of all DFD data elements and data structures.
A data dictionary has many advantages .The most obvious is documentation ;it is a valuable
reference in any organization . Another advantage is improving analyst/user communication
by establishing consistent definitions of various elements , terms , and procedures . also
control information maintained for each data element is cross-referenced in the data
dictionary. A data dictionary is an important step in developing a database.
Database users and application developers can benefit from an authoritative data
dictionary document that catalogs the organization, contents, and conventions of one or more
databases. This typically includes the names and descriptions of various tables and fields in
each database, plus additional details, like the type and length of each data element. There is
no universal standard as to the level of detail in such a document, but it is primarily a weak
kind of data.
The three classes to be defined are data elements, data structures, and data flows and
data stores.
 Data element is the smallest unit of data that provides for no further decomposition.
 Data structure is a group of data elements handled as a unit.
 Data flows and data stores are data structures in motion and data structures at rest,
respectively.














22








23













SYSTEM PHYSICAL DESIGN






24



SYSTEM DESIGN
I ntroduction to System Design
Design is the first step into the development phase for any engineered
product or system. Design is a creative process. A good design is the key to effective
system. The term “design” is defined as “the process of applying various techniques
and principles for the purpose of defining a process or a system in sufficient detail to
permit its physical realization”. It may be defined as a process of applying various
techniques and principles for the purpose of defining a device, a process or a system
in sufficient detail to permit its physical realization. Software design sits at the
technical kernel of the software engineering process and is applied regardless of the
development paradigm that is used. The system design develops the architectural
detail required to build a system or product. As in the case of any systematic
approach, this software too has undergone the best possible design phase fine tuning
all efficiency, performance and accuracy levels. The design phase is a transition from
a user oriented document to a document to the programmers or database personnel.
System design goes through two phases of development: Logical and Physical
Design.


I nput design

The design of input focuses on controlling the amount of input required,
controlling the errors, avoiding delay, avoiding extra steps and keeping the
process simple. The input is designed in such a way so that it provides security
and ease of use with retaining the privacy. Input Design considered the
following things:



25


o What data should be given as input?

o How the data should be arranged or coded?
o The dialog to guide the operating personnel in providing input.
o Methods for preparing input validations and steps to follow when error occur.

OUTPUT DESIGN

A quality output is one, which meets the requirements of the end user and
presents the information clearly. In output design it is determined how the
information is to be displaced for immediate need and also the hard copy
output. It is the most important and direct source information to the user.
Efficient and intelligent output design improves the system’s relationship to
help user decision-making.

Designing computer output should proceed in an organized, well thought out
manner; the right output must be developed while ensuring that each output
element is designed so that people will find the system can use easily and
effectively. When analysis design computer output, they should :
 Identify the specific output that is needed to meet the requirements.
 Select methods for presenting information.
 Create document, report, or other formats that contain information produced
by the system.









26



Sample Coding

Dim SSQL As String
Dim rs4a As New ADODB.Recordset

Private Sub Command1_Click()
Load Form2
Form2.Show
End Sub

Private Sub Command2_Click()
PNR = InputBox("ENTER THE PNR NO")
If Len(PNR) > 0 Then
If rs4a.State = 1 Then rs4a.Close

rs4a.CursorLocation = adUseClient

rs4a.Open "select * FROM PASSENGER WHERE PNR_NO = '" & PNR & "'", Cn,
adOpenDynamic, adLockOptimistic
TRAINNO = rs4a.Fields(2)
SOURCE = rs4a.Fields(4)
DESTINATION = rs4a.Fields(5)
COACH = rs4a.Fields(7)
JORDATE = rs4a.Fields(9)

Load unres
unres.Show
End If
End Sub

Private Sub Command3_Click()
Load trainlist
trainlist.Show
End Sub

Private Sub Command4_Click()
Load FARE
FARE.Show
End Sub

Private Sub Command5_Click()
Load Form1
Form1.Show


27
End Sub

Private Sub Command6_Click()
Load TRAININFO_DETAILS
TRAININFO_DETAILS.Show
End Sub

Private Sub Command7_Click()
PNR = InputBox("ENTER THE PNR NO")
If Len(PNR) > 0 Then
If rs4a.State = 1 Then rs4a.Close

rs4a.CursorLocation = adUseClient

rs4a.Open "select * FROM PASSENGER WHERE PNR_NO = '" & PNR & "'", Cn,
adOpenDynamic, adLockOptimistic
TRAINNO = rs4a.Fields(2)
SOURCE = rs4a.Fields(4)
DESTINATION = rs4a.Fields(5)
COACH = rs4a.Fields(7)
JORDATE = rs4a.Fields(9)

Load printticket
printticket.Show
End If

End Sub

Private Sub Form_Load()

End Sub

Private Sub second_Click()
Unload seco
Load ir
ir.Show
End Sub

TRAIN INFO DETAILS


Dim SQL As String
Dim COACH As String

Private Sub CAN_Click()
Unload Me
Me.Hide

End Sub



28
Private Sub Command1_Click()
Dim DT As Date
Dim I As Integer
Dim N As Integer

DT = FROMDATE.Value
If Text1.Text = "" Then
Text1.Text = "0"
Text5.Text = "0"
End If
If Text2.Text = "" Then
Text2.Text = "0"
Text6.Text = "0"
End If
If Text3.Text = "" Then
Text3.Text = "0"
Text7.Text = "0"
End If
If Text8.Text = "" Then
Text4.Text = "0"
Text8.Text = "0"
End If


Cn.BeginTrans
SSQL = "insert into INFO_TRAIN(TRAIN_NO, SLEEPER_SEATS, 1AC_SEATS,
2AC_SEATS,
3AC_SEATS,SLEEPER_FARE,1AC_FARE,2AC_FARE,3AC_FARE,FROMDATE,TODA
TE) values ('" & Label3.Caption & "'," & Text1.Text & "," & Text2.Text & "," & Text3.Text
& "," & Text4.Text & "," & Text5.Text & "," & Text6.Text & "," & Text7.Text & "," &
Text8.Text & ",'" & Format$(FROMDATE.Value, "d/M/yyyy") & "','" &
Format$(TODATE.Value, "d/M/yyyy") & "' )"
Cn.Execute SSQL
Cn.CommitTrans
MsgBox "TRAIN " & TRAINNO & " created.", vbInformation

For I = 1 To 90
DT = DT + 1
If Len(Text1.Text) > 0 Then
N = Val(Text1.Text)
For J = 1 To N
COACH = "S" & J

Cn.BeginTrans
SSQL = "INSERT INTO COACH (TRAIN_NO,COACHES,SEATS,DATEOFJOUR)
VALUES ( '" & TRAINNO & "','" & COACH & "', 30 ,'" & Format$(DT, "d/M/yyyy") & "'
)"
Cn.Execute SSQL
Cn.CommitTrans



29
Next J
End If

If Len(Text2.Text) > 0 Then
N = Val(Text2.Text)
For J = 1 To N
COACH = "A1" & J

Cn.BeginTrans
SSQL = "INSERT INTO COACH (TRAIN_NO,COACHES,SEATS,DATEOFJOUR)
VALUES ( '" & TRAINNO & "','" & COACH & "', 30 ,'" & Format$(DT, "d/M/yyyy") & "'
)"
Cn.Execute SSQL
Cn.CommitTrans
Next J

End If

If Len(Text3.Text) > 0 Then
N = Val(Text3.Text)
For J = 1 To N
COACH = "A2" & J

Cn.BeginTrans
SSQL = "INSERT INTO COACH (TRAIN_NO,COACHES,SEATS,DATEOFJOUR)
VALUES ( '" & TRAINNO & "','" & COACH & "', 30 ,'" & Format$(DT, "d/M/yyyy") & "'
)"
Cn.Execute SSQL
Cn.CommitTrans

Next J
End If

If Len(Text4.Text) > 0 Then
N = Val(Text4.Text)
For J = 1 To N
COACH = "A3" & J

Cn.BeginTrans

SSQL = "INSERT INTO COACH (TRAIN_NO,COACHES,SEATS,DATEOFJOUR)
VALUES ( '" & TRAINNO & "','" & COACH & "', 30 ,'" & Format$(DT, "d/M/yyyy") & "'
)"
Cn.Execute SSQL
Cn.CommitTrans

Next J
End If

Next I


30


' Load TRAININFO_DETAILS
'TRAININFO_DETAILS.Show
' Exit Sub
'ErrorHandler:
'cn.RollbackTrans
' MsgBox "TRAIN " & TRAIN_NO.Text & " not created.", vbInformation

End Sub

Private Sub Form_Load()
If F = 0 Then
TRAINNO = InputBox("ENTER TRAIN NO")
End If

Label3.Caption = TRAINNO
FROMDATE.Value = Now
TODATE.Value = DateAdd("m", 3, Now)

End Sub


SEARCH FOR TRAIN

Dim SSQL As String
Public TempRS As New ADODB.Recordset
Dim ds4 As Connection
Dim rs4 As Recordset
Dim rs4a As New ADODB.Recordset

Dim RS As New ADODB.Recordset
Private Sub Command1_Click()
Dim rs4a As New ADODB.Recordset

rs4a.CursorLocation = adUseClient

rs4a.Open "select
TRAIN_NO,TRAIN_NAME,SOUR_CODE,DEST_CODE,SOU_TIME,DEST_TIME from
TRAIN WHERE SOUR_CODE = '" & Combo1.Text & "' AND DEST_CODE= '" &
Combo2.Text & "'", Cn, adOpenDynamic, adLockOptimistic
On Error GoTo ErrorHandler
'ErrorHandler:
'Print

'rs4a.Close
'Set RS = New ADODB.Recordset
'RS.CursorLocation = adUseClient
'RS.Open "SELECT ", Cn, adOpenDynamic, adLockOptimistic, ADDCMD.Text
Set MSF.DataSource = rs4a


31
ErrorHandler:
Print
rs4a.Close



End Sub

Private Sub Command2_Click()
If rs4a.State = 1 Then rs4a.Close
JORDATE = DTPicker1.Value
SOURCE = Combo1.Text
DESTINATION = Combo2.Text
If Option1.Value = True Then
COACH = "S1"
ElseIf Option2.Value = True Then
COACH = "A1"
ElseIf Option3.Value = True Then
COACH = "A21"
ElseIf Option4.Value = True Then
COACH = "A31"
End If
TRAINNO = MSF.TextMatrix(MSF.Row, 1)


Load reserveform
reserveform.Show
Unload Me
Me.Hide
End Sub

Private Sub Form_Load()
DTPicker1.Value = Now

'Set rs4a = New Recordset
'Me.print1.Enabled = False

End Sub
Sub MsfInit()
MSF.Clear
MSF.ColWidth(0) = 800
MSF.ColWidth(1) = 1000
MSF.TextMatrix(0, 0) = "Site No."
MSF.TextMatrix(0, 1) = "Dimantion"
End Sub
Sub DisRecords()
If TempRS.State = 1 Then TempRS.Close
TempRS.Open "select SiteId,Sdie from SiteDet order by SiteId,SName", Conn
RNo = 1
MsfInit


32
Do While Not TempRS.EOF
MSF.TextMatrix(RNo, 0) = TempRS(0)
MSF.TextMatrix(RNo, 1) = TempRS(1)
TempRS.MoveNext
RNo = RNo + 1
Loop
End Sub

Private Sub Option1_Click()
If rs4a.State = 1 Then rs4a.Close
Command2.Enabled = False

Dim N As String
Label5.Caption = ""
'MsgBox ("HELLO" & MSF.TextMatrix(MSF.Row, 1))

'If MSF.TextMatrix(MSF.Row, 0) = "" Then Exit Sub
N = MSF.TextMatrix(MSF.Row, 1)
MsgBox (Format$(DTPicker1.Value, "d/M/yyyy"))

If Option1.Value = True Then
rs4a.Open "SELECT SUM(SEATS) FROM COACH WHERE COACHES LIKE 'S%' AND
DATEOFJOUR LIKE '" & Format$(DTPicker1.Value, "M/d/yyyy") & "' AND TRAIN_NO
= '" & N & "'", Cn, adOpenDynamic, adLockOptimistic
Label5.Caption = "NO OF SEATS AVAILABLE = " & rs4a.Fields(0)
End If
If rs4a.Fields(0) > 0 Then
Command2.Enabled = True
End If

rs4a.Close
End Sub

Private Sub Option2_Click()
If rs4a.State = 1 Then rs4a.Close
Command2.Enabled = False

Dim N As String
Label5.Caption = ""
'MsgBox ("HELLO" & MSF.TextMatrix(MSF.Row, 1))

'If MSF.TextMatrix(MSF.Row, 0) = "" Then Exit Sub
N = MSF.TextMatrix(MSF.Row, 1)
MsgBox (Format$(DTPicker1.Value, "d/M/yyyy"))

If Option2.Value = True Then
rs4a.Open "SELECT SUM(SEATS) FROM COACH WHERE COACHES LIKE 'A1%'
AND DATEOFJOUR LIKE '" & Format$(DTPicker1.Value, "M/d/yyyy") & "' AND
TRAIN_NO = '" & N & "'", Cn, adOpenDynamic, adLockOptimistic
Label5.Caption = "NO OF SEATS AVAILABLE = " & rs4a.Fields(0)


33
End If
If rs4a.Fields(0) > 0 Then
Command2.Enabled = True
End If

'rs4a.Close

End Sub

Private Sub Option3_Click()
If rs4a.State = 1 Then rs4a.Close
Command2.Enabled = False

Dim N As String
Label5.Caption = ""
'MsgBox ("HELLO" & MSF.TextMatrix(MSF.Row, 1))

'If MSF.TextMatrix(MSF.Row, 0) = "" Then Exit Sub
N = MSF.TextMatrix(MSF.Row, 1)
MsgBox (Format$(DTPicker1.Value, "d/M/yyyy"))

If Option3.Value = True Then
rs4a.Open "SELECT SUM(SEATS) FROM COACH WHERE COACHES LIKE 'A2%'
AND DATEOFJOUR LIKE '" & Format$(DTPicker1.Value, "M/d/yyyy") & "' AND
TRAIN_NO = '" & N & "'", Cn, adOpenDynamic, adLockOptimistic
Label5.Caption = "NO OF SEATS AVAILABLE = " & rs4a.Fields(0)
End If
If rs4a.Fields(0) > 0 Then
Command2.Enabled = True
End If

'rs4a.Close

End Sub

Private Sub Option4_Click()
If rs4a.State = 1 Then rs4a.Close
Command2.Enabled = False

Dim N As String
Label5.Caption = ""
'MsgBox ("HELLO" & MSF.TextMatrix(MSF.Row, 1))

'If MSF.TextMatrix(MSF.Row, 0) = "" Then Exit Sub
N = MSF.TextMatrix(MSF.Row, 1)
MsgBox (Format$(DTPicker1.Value, "d/M/yyyy"))

If Option4.Value = True Then


34
rs4a.Open "SELECT SUM(SEATS) FROM COACH WHERE COACHES LIKE 'A3%'
AND DATEOFJOUR LIKE '" & Format$(DTPicker1.Value, "M/d/yyyy") & "' AND
TRAIN_NO = '" & N & "'", Cn, adOpenDynamic, adLockOptimistic
Label5.Caption = "NO OF SEATS AVAILABLE = " & rs4a.Fields(0)
End If
If rs4a.Fields(0) <> Null Then
Command2.Enabled = True
End If

'rs4a.Close

End Sub

Private Sub Text1_Change()
If rs4a.State = 1 Then rs4a.Close

rs4a.Open "select DISTINCT(SOUR_CODE) from TRAIN WHERE SOURCE LIKE '" &
Text1.Text & "%'", Cn, adOpenStatic, adLockOptimistic
Combo1.Clear
On Error GoTo ErrorHandler

rs4a.MoveFirst
While (Not rs4a.EOF)
Me.Combo1.AddItem (rs4a.Fields(0))
'Me.Combo2.AddItem (rs4a.Fields(6))
rs4a.MoveNext
Wend
ErrorHandler:
Print

rs4a.Close
End Sub

Private Sub Text2_Change()
If rs4a.State = 1 Then rs4a.Close

rs4a.Open "select DISTINCT(DEST_CODE) from TRAIN WHERE DESTINATION
LIKE'" & Text2.Text & "%'", Cn, adOpenStatic, adLockOptimistic
Combo2.Clear
On Error GoTo ErrorHandler

rs4a.MoveFirst
While (Not rs4a.EOF)
'Me.Combo1.AddItem (rs4a.Fields(4))
Me.Combo2.AddItem (rs4a.Fields(0))
rs4a.MoveNext
Wend
ErrorHandler:
Print
rs4a.Close


35

End Sub


RESERVATION

Dim SSQL As String
Dim rs4a As New ADODB.Recordset
Dim pn As String
Dim SEAT As Integer
Dim NO As Integer

Private Sub back_Click()
Unload reserveform
Load seco
seco.Show

End Sub


Private Sub Command1_Click()
PNR = pn
Load printticket
printticket.Show
Unload Me
Me.Hide

End Sub

Private Sub Command2_Click()
AA:
pn = InputBox("ENTER THE THE PNR NO")
If pn = "" Then
GoTo AA
End If

If rs4a.State = 1 Then rs4a.Close

rs4a.CursorLocation = adUseClient
On Error GoTo ERR

rs4a.Open "select MAX(SEAT) from PASSENGER WHERE TRAIN_NO = '" &
TRAINNO & "' AND SOURCE = '" & SOURCE & "' AND DESTINATION = '" &
DESTINATION & "' AND COACH_NO LIKE '" & COACH & "' AND DATE_OFJOUR
LIKE '" & Format$(JORDATE, "M/d/yyyy") & "'", Cn, adOpenDynamic, adLockOptimistic
NO = rs4a.Fields(0)
ERR:
N0 = 0
SEAT = NO
For I = 0 To 5


36
SEAT = SEAT + 1
If Text3(I).Text = "" Then Exit For
Cn.BeginTrans
SSQL = "INSERT INTO PASSENGER
(PNR_NO,TRAIN_NO,TRAIN_NAME,SOURCE,DESTINATION,PASS_NAME,COACH
_NO,SEAT,DATE_OFJOUR,AGE,SEX,CITIZEN,BIRTH ) VALUES ( '" & pn & "','" &
TRAINNO & "','" & TRAIN_NAME.Text & "','" & SOURCE & "','" & DESTINATION &
"','" & Text3(I).Text & "','" & COACH & "'," & SEAT & ",'" & Format$(JORDATE,
"d/M/yyyy") & "'," & Val(Text9(I).Text) & ",'" & Combo1(I).Text & "','NO' ,'" &
Combo2(I).Text & "' )"
Cn.Execute SSQL
Cn.CommitTrans
Cn.BeginTrans
SSQL = "UPDATE COACH SET SEATS = SEATS - 1 WHERE COACHES LIKE '"
& COACH & "' AND DATEOFJOUR LIKE '" & Format$(JORDATE, "M/d/yyyy") & "'
AND TRAIN_NO = '" & TRAINNO & "'"
Cn.Execute SSQL
Cn.CommitTrans
Next I
Exit Sub
MsgBox ("TICKET CREATED")
Command2.Visible = False
Command1.Value = True

'ERR:
'MsgBox ("VALUES ARE NOT PROPERLY HANDLE")


End Sub

Private Sub Command3_Click()

End Sub

Private Sub Form_Load()
tr = TRAINNO

Text15.Text = SOURCE
Text16.Text = DESTINATION
Text17.Text = JORDATE
lass = COACH
If rs4a.State = 1 Then rs4a.Close

rs4a.CursorLocation = adUseClient

rs4a.Open "select TRAIN_NAME from TRAIN WHERE TRAIN_NO = '" & TRAINNO
& "'", Cn, adOpenDynamic, adLockOptimistic
TRAIN_NAME = rs4a.Fields(0)




37
For I = 0 To 5
Combo1(I).AddItem ("MALE")
Combo1(I).AddItem ("FEMALE")
Combo2(I).AddItem ("LOWER")
Combo2(I).AddItem ("MIDDLE")
Combo2(I).AddItem ("UPPER")
Combo2(I).AddItem ("SIDE LOWER")
Combo2(I).AddItem ("SIDE UPPER")
Next I
End Sub



PRINT TICKET

Dim SSQL As String
Dim rs4a As New ADODB.Recordset
Dim NO As Integer
Dim FARE As Integer



Private Sub back_Click()
Unload Me
Load seco
seco.Show Mode
End Sub

Private Sub Form_Load()

Text1.Text = PNR
Text3.Text = Format$(JORDATE, "M/d/yyyy")

Text4.Text = TRAINNO

Text6.Text = SOURCE
Text7.Text = DESTINATION
Text10 = COACH
If rs4a.State = 1 Then rs4a.Close

rs4a.CursorLocation = adUseClient

rs4a.Open "select TRAIN_NAME from TRAIN WHERE TRAIN_NO = '" & TRAINNO
& "'", Cn, adOpenDynamic, adLockOptimistic
Text5.Text = rs4a.Fields(0)
If rs4a.State = 1 Then rs4a.Close

rs4a.CursorLocation = adUseClient



38
rs4a.Open "select PASS_NAME,COACH_NO,SEAT,AGE,SEX,CITIZEN,BIRTH from
PASSENGER WHERE PNR_NO = '" & PNR & "'", Cn, adOpenDynamic,
adLockOptimistic

Set MSF.DataSource = rs4a
If rs4a.State = 1 Then rs4a.Close

rs4a.CursorLocation = adUseClient

rs4a.Open "select COUNT(*) from PASSENGER WHERE PNR_NO = '" & PNR & "'",
Cn, adOpenDynamic, adLockOptimistic
NO = rs4a.Fields(0)
If Left(COACH, 1) = "S" Then
If rs4a.State = 1 Then rs4a.Close

rs4a.CursorLocation = adUseClient

rs4a.Open "select SLEEPER_FARE from INFO_TRAIN WHERE TRAIN_NO = '" &
TRAINNO & "'", Cn, adOpenDynamic, adLockOptimistic
FARE = rs4a.Fields(0)

ElseIf Left(COACH, 2) = "A1" Then
If rs4a.State = 1 Then rs4a.Close

rs4a.CursorLocation = adUseClient

rs4a.Open "select [1AC_FARE] from INFO_TRAIN WHERE TRAIN_NO = '" &
TRAINNO & "'", Cn, adOpenDynamic, adLockOptimistic
FARE = rs4a.Fields(0)

ElseIf Left(COACH, 2) = "A2" Then
If rs4a.State = 1 Then rs4a.Close

rs4a.CursorLocation = adUseClient

rs4a.Open "select [2AC_FARE] from INFO_TRAIN WHERE TRAIN_NO = '" &
TRAINNO & "'", Cn, adOpenDynamic, adLockOptimistic
FARE = rs4a.Fields(0)


ElseIf Left(COACH, 2) = "A3" Then
If rs4a.State = 1 Then rs4a.Close

rs4a.CursorLocation = adUseClient

rs4a.Open "select [3AC_FARE] from INFO_TRAIN WHERE TRAIN_NO = '" &
TRAINNO & "'", Cn, adOpenDynamic, adLockOptimistic
FARE = rs4a.Fields(0)




39
End If
FARE = FARE * NO
Label2.Caption = Label2.Caption & FARE

End Sub



DATABASE DESIGN

A database is an organized mechanism that has the capability of storing
information through which a user can retrieve stored information in an
effective and efficient manner. The data is the purpose of any database and
must be protected.

The database design is a two level process. In the first step, user requirements
are gathered together and a database is designed which will meet these
requirements as clearly as possible. This step is called Information Level
Design and it is taken independent of any individual DBMS.

In the second step, this Information level design is transferred into a design for
the specific DBMS that will be used to implement the system in question. This
step is called Physical Level Design, concerned with the characteristics of the
specific DBMS that will be used. A database design runs parallel with the
system design. The organization of the data in the database is aimed to achieve
the following two major objectives.
 Data Integrity
 Data independence

Normalization is the process of decomposing the attributes in an application,
which results in a set of tables with very simple structure. The purpose of
normalization is to make tables as simple as possible. Normalization is carried
out in this system for the following reasons.

 To structure the data so that there is no repetition of data , this helps in saving.


40
 To permit simple retrieval of data in response to query and report request.
 To simplify the maintenance of the data through updates, insertions, deletions.
 To reduce the need to restructure or reorganize data which new application
requirements arise.



RELATIONAL DATABASE MANAGEMENT SYSTEM (RDBMS):

A relational model represents the database as a collection of relations. Each
relation resembles a table of values or file of records. In formal relational
model terminology, a row is called a tuple, a column header is called an
attribute and the table is called a relation. A relational database consists of a
collection of tables, each of which is assigned a unique name. A row in a tale
represents a set of related values.

RELATIONS, DOMAINS & ATTRIBUTES:

 A table is a relation. The rows in a table are called tuples. A tuple is an
ordered set of n elements. Columns are referred to as attributes. Relationships
have been set between every table in the database. This ensures both
Referential and Entity Relationship Integrity. A domain D is a set of atomic
values. A common method of specifying a domain is to specify a data type
from which the data values forming the domain are drawn. It is also useful to
specify a name for the domain to help in interpreting its values. Every value in
a relation is atomic, that is not decomposable.

 RELATIONSHIPS:

 Table relationships are established using Key. The two main keys of prime
importance are Primary Key & Foreign Key. Entity Integrity and Referential
Integrity Relationships can be established with these keys.Entity Integrity


41
enforces that no Primary Key can have null values.Referential Integrity
enforces that no Primary Key can have null values.


 Referential Integrity for each distinct Foreign Key value, there must exist a
matching Primary Key value in the same domain. Other key are Super Key
and Candidate Keys.
 Relationships have been set between every table in the database. This ensures
both Referential and Entity Relationship Integrity.

NORMALIZATION:

As the name implies, it denoted putting things in the normal form. The
application developer via normalization tries to achieve a sensible
organization of data into proper tables and columns and where names can be
easily correlated to the data by the user. Normalization eliminates repeating
groups at data and thereby avoids data redundancy which proves to be a great
burden on the computer resources. These includes:

 Normalize the data.
 Choose proper names for the tables and columns.
 Choose the proper name for the data.

First Normal Form:

The First Normal Form states that the domain of an attribute must include only
atomic values and that the value of any attribute in a tuple must be a single
value from the domain of that attribute. In other words 1NF disallows
“relations within relations” or “relations as attribute values within tuples”. The
only attribute values permitted by 1NF are single atomic or indivisible values.

The first step is to put the data into First Normal Form. This can be donor by
moving data into separate tables where the data is of similar type


42

in each table. Each table is given a Primary Key or Foreign Key as per
requirement of the project. In this we form new relations for each nonatomic
attribute or nested relation. This eliminated repeating groups of data.

A relation is said to be in first normal form if only if it satisfies the constraints
that contain the primary key only.

Second Normal Form:

According to Second Normal Form, For relations where primary key contains
multiple attributes, no nonkey attribute should be functionally dependent on a
part of the primary key.

In this we decompose and setup a new relation for each partial key with its
dependent attributes. Make sure to keep a relation with the original primary
key and any attributes that are fully functionally dependent on it. This step
helps in taking out data that is only dependant on apart of the key.

A relation is said to be in second normal form if and only if it satisfies all the
first normal form conditions for the primary key and every non-primary key
attributes of the relation is fully dependent on its primary key alone.

Third Normal Form:

According to Third Normal Form, Relation should not have a non-key
attribute functionally determined by another non-key attribute or by a set of
non-key attributes. That is, there should be no transitive dependency on the
primary key.

In this we decompose and set up relation that includes the non-key attributes
that functionally determines other non-key attributes. This step is taken to get
rid of anything that does not depend entirely on the Primary Key.


43

A relation is said to be in third normal form if only if it is in second normal
form and more over the non key attributes of the relation should not be depend
on other non key attribute.



Table Design

TABLE : TRAIN
Train_no text
Train_name text
Source text
Source code text
Destination text
Destination code text
Source time text
Destination time text

TABLE TRAIN_INFO
Train_no text
Sleeper seats number
1ac seats number
2ac seats number
3ac seats number
Sleeper fare number
1ac fare number
2ac fare number
3ac fare number
Fromdate date
Todate date

TABLE COACH


44
Train no text
Coaches text
Seats number
Date of jour date

TABLE PASSENGER
Pass number auto number
Pnr num text
Train no text
Train name text
Source text
Destination text
Pass name text
Coach no text
Seat number
Date of jour date
Age number
Sex text
Citizen text
Birth text
















45

















INPUT /OUTPUT SCREEN














46



Form design- Sample Screen Shots







47






48











49







50


















51
TESTING
SYSTEM TESTING

System testing is a critical aspect of Software Quality Assurance and
represents the ultimate review of specification, design and coding. Testing is a process of
executing a program with the intent of finding an error.
A good test is one that has a probability of finding an as yet undiscovered error.
The purpose of testing is to identify and correct bugs in the developed system. Nothing is
complete without testing. Testing is the vital to the success of the system.
In the code testing the logic of the developed system is
tested. For this every module of the program is executed to find an error. To perform
specification test, the examination of the specifications stating what the program should do
and how it should perform under various conditions.
Unit testing focuses first on the modules in the proposed
system to locate errors. This enables to detect errors in the coding and logic that are
contained within that module alone.
Those resulting from the interaction between modules are initially avoided. In unit testing
step each module has to be checked separately. System testing does not test the software
as a whole, but rather than integration of each module in the system. The primary concern
is the compatibility of individual modules.
One has to find areas where modules have been designed with
different specifications of data lengths, type and data element name. Testing and validation
are the most important steps after the implementation of the developed system. The
system testing is performed to ensure that there are no errors in the implemented system.
The software must be executed several times in order to find out the errors in the different
modules of the system.
Validation refers to the process of using the new
software for the developed system in a live environment i.e., new software inside the
organization, in order to find out the errors.
The validation phase reveals the failures and the bugs in the
developed system. It will be come to know about the practical difficulties the system faces
when operated in the true environment. By testing the code of the implemented software,
the logic of the program can be examined. A specification test is conducted to check
whether the specifications stating the program are performing under various conditions.
Apart from these tests, there are some special tests conducted which are given below: Peak
Load Tests: This determines whether the new system will handle the volume of activities
when the system is at the peak of its processing demand. The test has revealed that the new
software for the agency is capable of handling the demands at the peak time. Storage
Testing: This determines the capacity of the new system to store transaction data on a disk
or on other files. The proposed software has the required storage space available, because
of the use of a number of hard disks. Performance Time Testing: This test determines the
length of the time used by the system to process transaction data. In this phase the


52
software developed Testing is exercising the software to uncover errors and ensure the
system meets defined requirements. Testing may be done at 4 levels

• Unit Level

• Module Level

• Integration & System

• Regression



UNIT TESTING
A Unit corresponds to a screen /form in the package. Unit testing focuses on
verification of the corresponding class or Screen. This testing includes testing of control
paths, interfaces, local data structures, logical decisions, boundary conditions, and error
handling. Unit testing may use Test Drivers, which are control programs to co-ordinate
test case inputs and outputs, and Test stubs, which replace low-level modules. A stub is a
40
dummy subprogram.

MODULE LEVEL TESTING
Module Testing is done using the test cases prepared earlier. Module is defined during the
time of design.

INTEGRATION TESTING
Integration testing is used to verify the combining of the software modules. Integration
testing addresses the issues associated with the dual problems of verification and program
construction. System testing is used to verify, whether the developed system meets the
requirements.

REGRESSION TESTING
Each modification in software impacts unmodified areas, which results serious injuries to
that software. So the process of re-testing for rectification of errors due to modification is
known as regression testing. Installation and Delivery Installation and Delivery is the process
of delivering the developed and tested software to the customer.








53















IMPLEMENTATION











54


SYSTEM IMPLEMENTATION

Implementation includes all those activities that take place to convert from the
old system to the new. The old system consists of manual operations, which is operated in
a very different manner from the proposed new system. A proper implementation is
essential to provide a reliable system to meet the requirements of the organizations. An
improper installation may affect the success of the computerized system

IMPLEMENTATION METHODS:
There are several methods for handling the implementation and the consequent conversion
from the old to the new computerized system.

The most secure method for conversion from the old system to the new system is to run the
old and new system in parallel. In this approach, a person may operate in the manual older
processing system as well as start operating the new computerized system. This method
offers high security, because even if there is a flaw in the computerized system, we can
depend upon the manual system. However, the cost for maintaining two systems in parallel
is very high. This outweighs its benefits.

Another commonly method is a direct cut over from the existing manual system to the
computerized system. The change may be with in a week or with in a day. There are no
parallel activities. However, there is no remedy in case of a problem. This strategy requires
careful planning.

A working version of the system can also be implemented in one part of the organization
and the personnel will be piloting the system and changes can be made as and when
required. But this method is less preferable due to the loss of entirety of the system.

IMPLEMENTATION PLAN:
The implementation plan includes a description of all the activities that must occur to
implement the new system and to put it into operation. It identifies the personnel responsible
for the activities and prepares a time chart for implementing the system. The implementation
plan consists of the following steps.

o List all files required for implementation.

o Identify all data required to build new files during the implementation.

o List all new documents and procedures that go into the new system.

The implementation plan should anticipate possible problems and must be able to deal with
them. The usual problems may be missing documents; mixed data formats between current
and files, errors in data translation, missing data etc



55











LIMITATIONS
AND
FUTURE SCOPE










56
Limitations
The new system has been designed to meet almost all of the user requirements but it too has
certain limitations some of which can be enhanced in the future enhancements or updates.
Supports only Multiple choice and no Theory
The existing system supports only multiple choice questions and these can be used
only for the logic testing of the student whereas paper based tests can provide a overall result
of the users knowledge for that topic. This will do injustice to users who are sometimes aware
of answers but not sure completely. It supports only two values True and False. If the selected
answer is true the user gets marks, If not loses.
No Image Support
The existing system has no image support at present and so images and diagrams
cannot be included in the exam which would make it very difficult to ask certain questions in
certain subjects. Providing diagrams externally is at present the only feasible choice
available.

No Back Option Available
The existing system also lacks a back option which would take a user to a previously
answered question in case he wants to check or change his choice. This makes it very
difficult and quite stressf ul for the user to choose an option which is totally contrary to the
theory tests in which the user can review and change his answers. This has been an important
point in the proposed enhancements in the system.


Exam Time Cannot be Modified
The existing system allows the exam time to be set only once at the time of system
set up which cannot be changed as per desired and all the exams will be conducted for the
preset time only. If the user wants to increase or decrease the time for exams the system will
have to be set up again. This is also one of the proposed enhancements.




57


Future Scope
Enhancements are the perquisite for development of a system. Every existing system has
proposed enhancements which make it better and easier to use and more secure. The
enhancements that have been proposed for this system are listed here.



Including Image Support.
The existing system has no image support due to which the images cannot be used. It
will be one of the priorities in the proposed enhancements to enable Image Support in the
system.
Including Back Option
The new system will have a back option which will enable the users to go back to
previously answered questions and change them if needed. It will enable the user a hassle free
exam so that the user can properly utilize the total time allotted for the test.
Facility to Set Exam Time.
The new system will allow the faculty to set the exam time for a particular subject. It
will increase the efficiency of the system greatly as it will enable each subject to be tested for
a different duration as desired and required.
.








58



CONCLUSION
This project is about the designing the railway reservation system using M S Access, as back
end and Visual Basic 6.0 as front end. This project presents an investigative view of present
railway reservation system including the history of booking tickets and cancelled tickets.
Present system of railway reservation system is having some shortcoming on which we have
tried to work on that to eliminate the disadvantages.
We have made a database for passengers and trains and connected these two tables from
the custom made data entry form built in Visual Basic 6.0. There are options for new entry
which will be stored in M S Access database and retrieved from database in future.
This project was a small attempt to make the railway reservation system using M S Access,
and Visual Basic 6.0.
In the last we conclude that Indian Railway is having a strong IT Infrastructure and a well-
equipped railway reservation system but there is some shortcoming in the system on which
we have tried to work on it and successfully completed our project.











59




BIBLIOGRAPHY

Books
 A Complete Guide to Programming in Visual Basic .Net
 A Complete Visual Basic 6 Training Course: How to Programme: Package
 Advanced Programming Using Visual Basic: Version 6.0
 Access 2003 Power Programming with VBA
 Advanced MS Visual Basic
Site Address
 www.associatedcontent.com
 www.members.tripod.com
 www.vbcodesource.com















60



List of Tables
1. Train InfoDetails 21
2. Search For Train 24
3. Reservation 38
4. Print Ticket 41


















61



List of Figures
1. Data Flow Diagram 24
2. ER Diagram 26