Professional Documents
Culture Documents
ACKNOWLEDGEMENT
We are also thankful to Ms. Sreelekshmi S. (our project guide) for her constant
support in the Design, Implementation and Evaluation of this project. She helped a lot
with her constructive criticism and invaluable suggestions, which benefited us a lot.
ABSTRACT
INTRODUCTION
Railway Ticket System (RTS) is interactive software, which is developed for the
issuing of a railway ticket. It is developed while keeping in mind the need of an updated
ticket issuing software for the Southern Railways (Southern Zone of Indian Railways).
Microsoft Visual Basic 6.0 Enterprise Edition is used as the front-end software
and Microsoft Access 2003 as back-end for the development of the software.
The software includes options for checking the status of a railway ticket and
retrieves the information required, especially when the ticket is a RAC or in waiting list,
so that the passenger can know his ticket priority in the lists. The software provides easy
and faster searching options and generation of the ticket that increases the efficiency of
OBJECTIVES
The main objective of this project is to study the manual procedure carried out for
the issuing of a railway ticket to senior citizens and non-senior citizens by the Indian
Railways and to develop management software that would simplify the existing process.
Designing user-friendly GUI screens, being specific in generating the output to the user
of the system (operator), generating reports related to the specification of the user and
that would simplify the manual task, creation of new train routes, eventually creating
To achieve all these objectives effectively and efficiently, more care has been
given to the data collected, stored, retrieved, displayed, updated and manipulated within a
short time and a little effort. The proposed system is found to be efficient and accurate
DESCRIPTION
searching the database for available seats, and then accordingly reserves the seat for the
passenger. The operator can then check for the status of the passenger seat, whether it is
passenger wishes to cancel the ticket, he can do so. Using RTS, the operator can easily
cancel a ticket. According the date reserved and the date, on which the ticket is cancelled,
The railway ticket is issued with a unique number which is only valid for the
particular ticket. Its’ called PNR (Passenger Name Record). This code is used to track the
The RTS also allow the passenger to use the Journey Planner. This is one of the
innovative ideas that are introduced in this project. It enables the easy selection of direct
and connection trains easily. This feature is big relief to the existing system as the
passenger can plan his journey according to his needs very easily.
Tool Used
SYSTEM SPECIFICATION
HARDWARE SPECIFICATION
SOFTWARE REQUIREMENT
SOFTWARE DESCRIPTION
Microsoft Windows: -
Windows provides a broad range of graphical functions for drawing lines and
geometric shapes and changing colour. It also provides library functions for accessing
screen, printers, keyboard, mouse and functions for working with various other types of
objects like menus, bitmaps, icons etc. These libraries are a part of operating system.
Every Windows environment has its unique API. The API that supports Windows
95, 98, 2000, XP are 32 bits API that is, all the functions supported by the API can work
with 32 bits of information. The API of Windows 2000, XP has some special features for
file security and support for multiple processors. This collection of working functions is
maintained in files stored in the SYSTEM32 directory in the hard disk drive. This is
created when the Windows is installed.
GDI.DLL – It is a Windows 32-bit graphics driver interface API library and is a core
Windows component. It contains functions for drawing graphics, accessing hardware,
displaying output etc.
USER32.DLL – It is a Windows user library used to provide support for user interface
routines. It contains functions that deal with the user interface, like creating and
managing Windows.
KERNEL32.DLL – It provides Windows 32-bit API support and is the core Windows
component. It contains functions, which deal with critical system resources, like
functions for allocating memory, accessing files etc.
Windows applications are, very often large in size, larger than the amount of
physical memory installed in the system. To get around this problem, Windows only
loads those modules of an application, which are needed. Using this technique, Windows
also greatly reduces memory consumption.
The newer programming languages like C++ and Visual Basic follow a different
programming approach: Object-Oriented Programming (OOPs) and Event driven
programming. Microsoft refers Visual Basic as an event-driven programming language.
Visual Basic has many elements of an object-oriented language such as Java. Each
release of Visual Basic moves it a little closer to a true object-oriented language.
In event driven model each user action can cause an event to occur, which triggers a basic
procedure.
Forms
Forms are individual Windows used in the application. Normally forms are the
interface of the application. In forms we can place data, graphics and controls. Visual
Basic supports to create two types of interfaces – Single Document Interface (SDI) and
Multiple Document Interface (MDI).
Controls
Controls are objects that are put into the form, to display information or get a
response from the user. All of the usual Windows features are classes as controls. There
are three broad categories of controls in Visual Basic:
Intrinsic Control
These are the controls that are included in the Toolbox of Visual Basic.
Examples: Textbox, Command button, Label box.
Objects that can be added to the Toolbox
The Microsoft Excel worksheet object, Microsoft Project calendar object, etc can
be added to the Toolbox. So they also can be considered as controls. Some of these
controls allow automation, which allows programming another application objects from
within a Visual Basic Application.
Modules
A module is like a normal basic program but it does not have the power to create
display or get input from the user; the forms control all this. Modules are stored in files
with .BAS extensions.
Microsoft Access: -
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 2007 Microsoft Office system.
Access can use data stored in Access/Jet, Microsoft SQL Server, Oracle, or any ODBC-
compliant data container (including MySQL and PostgreSQL).
Uses
Some professional application developers use Access for rapid application development,
especially for the creation of prototypes and standalone applications that serve as tools
for on-the-road salespeople. Access does not scale well if data access is via a network, so
applications that are used by more than a handful of people tend to rely on Client-Server
based solutions. However, an Access “front end” (the forms, reports, queries and VB
code) can be used against a host of database back-ends, including JET (file-based
database engine, used in Access by default), Microsoft SQL Server, Oracle, and all other
ODBC-compliant product.
In addition to traditional ODBC methods, Access also offers “Access Data Projects” for
accessing SQL Server data, which provides a number of advantages over linked tables.
Features
One of the benefits of Access from a programmer’s perspective is its relative
compatibility with SQL (structured query language) – queries may be viewed graphically
or edited as SQL statements, and SQL statements can be used directly in Macros and
VBA Modules to manipulate Access tables. Users may mix and use both VBA and
“Macros” for programming forms and logic and offers object-oriented possibilities.
MSDE 2000 (Microsoft SQL Server Desktop Engine), a scaled down version of
Microsoft SQL Server 2000, has been a free download for a decade and may be used with
Access as an alternative to the Jet Database Engine.
Unlike other RDBMS, Microsoft Access does not implement database triggers or stored
procedures.
Starting in Access 2000 (Jet 2.0), there is a new syntax for creating queries with
parameters, in a way that looks like creating stored procedures, but these procedures are
still limited to one statement per procedure.
In ADP files (supported in Access 2000 and later), the database-related features are
geared more towards a client-server architectures with MSDE or Microsoft SQL Server
serving as the Back-end instead of using the Jet Engine. Thus, it supports the creation of
nearly all objects in the underlying server (tables with constraints and triggers, views,
stored procedures and UDF-s). However, only forms, reports, macros and modules are
stored in the ADP file (the other objects are stored in the back-end database). This
centralization of queries and tables in the database server provide a more reliable
development environment for most businesses.
Access includes an Upsizing Wizard that allows users to upsize their database to
Microsoft SQL Server if they want to move to an ODBC client-server database.
One recommended technique is to migrate from SQL Server and utilize Access Data
Projects. This allows stored procedures, views, and constraints using standard SQL.
Additionally this full client-server significantly reduces maintenance and availability
problems.
PROJECT DESCRIPTION
The Indian Railways issues railway tickets for the citizens, so that they can use the rail
transport facility. There are many categories of classes, for example, air-conditioned
class, first class, sleeper class and general class. Each has its own features. Sleeper class
is used for traveling more than a day.
Reservation
For long-distance travel, reservation of a berth can be done for comfortable travel up to
two months prior to the date of intended travel. Details such as the name, age and
concession (if eligible) are required and are recorded on the ticket. The ticket price
usually includes the base fare which depends on the classification of the train (example:
super-fast surcharge if the train is classified as a super-fast), the class in which one wishes
to travel and the reservation charge for overnight journeys.
Fare Calculation:-
The fare is calculated on the basis of the distance (in km) and the class
Fare in A.C. Class - Rs. (70% of the distance)
Fare in First Class - Rs. (60% of the distance)
Fare in Sleeper Class - Rs. (50% of the distance)
Fare in General Class - Rs. (40% of the distance)
The above is for persons less than 60 years of age. The senior citizens (persons of 60
years and above) can avail of a reduction of 15% in all the above classes.
Confirmed List
If a seat is not available, then the ticket is given a wait listed number; else the ticket is
confirmed, and a berth number is printed on the ticket.
RAC
Some of the tickets are assigned to the RAC or Reservation against Cancellation which is
between the waiting list and the confirmed list. These allow the ticket holder to board the
train and obtain an allotted seat decided by a ticket collector, after the ticket collector has
ascertained that there is a vacant (absentee) seat. It is a way of maximizing the number of
wait-listed passengers to be accommodated in case of a cancellation.
Wait-Listed Ticket
A person receiving a wait listed ticket will have to wait until there are enough
cancellations to enable him to move up the list and obtain a confirmed ticket. If his ticket
is not confirmed on the day of departure, he may not board the train.
Our project deals with the automation of the most of the processes involved in the issue
of a railway ticket. These procedures are done by a ticket issuing operator.
The main steps of reservation of a ticket are as follows: -
Checking for availability.
Inputting details.
Processing the data.
Allotting a seat along with a class.
A PNR is formulated.
Calculation of ticket fare and printing of the ticket.
Status
In this phase, a passenger can get to know his ticket details. Most of the time, the
passengers in the RAC list and the waiting list avail of this facility often, so that they can
understand their priority in these lists.
An additional feature is the “emergency tab” in the status page. Here any person can
request the operator to type in the PNR code of any passenger, who is under serious
medical condition. The emergency tab gives the contact number of this person (this is
input in the reservation phase) using which the relatives or other concerned persons can
be informed about the current condition of the passenger.
Cancellation
In this phase, a passenger can cancel his/her ticket before 24 hours of the travel time, so
as to get 85% refund. Thus, this available seat is now allotted to the passenger with the
priority number 1 on the RAC list. All other priority numbers are decremented by one.
Journey Planner
It is one of the innovative ideas in this project. The journey planner usually means
planning the journey. In Indian Railways, there is a journey planner entitled “Trains
between stations”. But our project is aimed for a better journey planner. The connection
trains provides an alternative solution, especially in the cases of festival seasons
Even though he/she might arrive at his/her destination some hours later, he/she will be
able to travel comfortably.
The passenger is asked for the starting and destination stations and the operator then
display the currently available routes and trains. The passenger can choose the routes and
the available trains accordingly.
In the intermediate station(s), the passenger will only have to wait for 30mins-60mins in
between from getting down from one train and boarding the next train. This feature can
be best utilized by the government diplomats, who have to use the rail transport to attend
the meetings and conferences where they have to meet on that day itself, with the
tolerance of some hours.
SYSTEM DESIGN
The DFD may be used to represent a system or software at any level of abstraction. DFDs
may be portioned into levels that represent increasing information flow and functional
details. Therefore DFD provides a mechanism for functional modeling as well as
information flow modeling.
A Level 0 data flow diagram, also called a fundamental system model or a context model
represents the entire software as a single bubble with input and output data indicated by
incoming and outgoing arrows respectively. Additional process and information flow path
are represented on the level 0 data flow diagram is portioned to reveal more details.
Choice entered by
Enter
Option Select
user to login as intern
an Operator / al
Admin
Logge Logged in
d in Reservation as
as /Cancellatio Operator
n /Status
Edit
structure of
database
Reservation
e su
Is
Process
R
User Input
PN
Data
Request
Store
Chec
k
If appropriate
Add to
data
store
Reservatio
n Done
Cancellation
Proces Check
User Input
s
Reque
Delete if
appropriate, Cancellation
else send Done
ERROR
message
Status
Data Store
Display Status
PNR
i/p to
new status
train cancellation
trains
data
station
new data
routes reservation
journey planner
PNR
stations
data fed ticket + Train
editing in no &
database routes
Database Design:-
Kilometers Number
Input Design:-
Proposed software uses user-friendly graphical user interface for input purpose. Data can
be easily input by the user through this screen. Repetition is avoided in data entry screen.
Whenever data, which is already input, is entered again, the system alerts you with error
messages.
The operator can easily enter the data flexibly, thus is the striking feature of the proposed
system. The beaming features of VB forms are used in the design and hence the design
stands one step forward of others. The following are the various input forms.
Reservation
Cancellation
Status
Journey planner
Output Design:-
The Computer output is the most important of information to the user. Efficient
intelligence output design would improve the system relationship with the user and help
in decision making. In online applications the information is displayed on the screen. A
major form of output is hard copy from the printer. Printout should be designed around
the output requirement of user.
TICKET
Journey planner
SYSTEM IMPLEMENTATION
Implementation means converting a new system into operation. The source code
that is actual program is developed in this phase. In the proposed system, the source code
is written in Visual Basic 6.0. The installation of the software is also done in this phase.
System testing is the stages of implementation, which is aimed at ensuring that the
system works accurately and efficiently before line operation commences. The following
types of tests were performed after developing a test plan. The approach was to test each
entity with successively large ones, up to the system level.
Program Testing
A program represents the logical elements of the system. With program testing,
the actual output was compared with the expected output. This test checks for syntax
errors and logical errors. When there was an error, the sequence of instructions was traced
and the problem was determined.
String Testing
The individual program modules that work perfectly when tested alone were
integrated with the related program modules to test how they interact with the total
system.
System Testing
System testing was designed to uncover weakness that was not found in the
earlier tests. The total system was validated, as the users in the operational environment
would implement it.
This testing was performed with the objective of testing the users on the validity
and reliability of the system. It was verified that the procedure operate to the
specifications and also that vital data integrity was maintained.
Administrator screenshots
Login
Delete Train 1
Delete Train 2
View Stations
Edit Stations
SAMPLE CODE
Reservation
Private Sub search3() ' Checks whether source & destn are same
If (txtSource = txtDestn) Then
err = 1
End If
End Sub
Call search1
If (err = 1) Then
MsgBox "Invalid Source", vbOKOnly + vbCritical, "RETRY"
Exit Sub
End If
Call search2
If (err = 1) Then
MsgBox "Invalid Destination Entry", vbOKOnly + vbCritical, "RETRY"
Exit Sub
End If
Call search3
If (err = 1) Then
MsgBox "Source & Destination can't be same", vbOKOnly + vbCritical, "RETRY"
Exit Sub
End If
If ((txtAge < 0) Or (txtAge > 105)) Then
GoTo Errorhandler1
End If
If (rs.RecordCount > -1 And rs.RecordCount < 12) Then
On Error GoTo Errorhandler1
rs.AddNew
PNRReserve = cmbTrainno.Text + cmbClass.Text + Format(Now, "hhmmss") +
Format(Now, "ddmm")
rs.fields(0) = PNRReserve
rs.fields(1) = txtName.Text
rs.fields(2) = txtAge.Text
rs.fields(3) = sx
rs.fields(4) = txtSource.Text
rs.fields(5) = txtDestn.Text
frmTicket.Show
End If
Exit Sub
rs.fields(6) = rate
ElseIf (cmbClass.Text = "SC") Then
If (txtAge.Text < 60) Then
rate = (a2 - a1) * (50 / 100)
Else
rate = (a2 - a1) * (50 / 100) * (85 / 100)
End If
If (rate < 0) Then
rate = -(rate)
End If
rs.fields(6) = rate
ElseIf (cmbClass.Text = "FC") Then
If (txtAge.Text < 60) Then
rate = (a2 - a1) * (60 / 100)
Else
rate = (a2 - a1) * (60 / 100) * (85 / 100)
End If
If (rate < 0) Then
rate = -(rate)
End If
rs.fields(6) = rate
ElseIf (cmbClass.Text = "AC") Then
If (txtAge.Text < 60) Then
rate = (a2 - a1) * (70 / 100)
Else
rate = (a2 - a1) * (70 / 100) * (85 / 100)
End If
If (rate < 0) Then
rate = -(rate)
End If
rs.fields(6) = rate
Else
MsgBox "Wrong Entry", vbOKOnly + vbCritical, "RETRY"
End If
rs.Update
NameReserve = txtName.Text
AgeReserve = txtAge.Text
SexReserve = sx
StReserve = txtSource.Text
DestReserve = txtDestn.Text
classReserve = cmbClass.Text
StatusReserve = "RAC"
iResponse = MsgBox(StatusReserve, vbOKOnly + vbInformation, "SUCCESS")
If (iResponse = vbOK) Then
frmRESERVATION.Hide
frmTicket.Show
End If
Exit Sub
rs.fields(7) = "0"
Else
rs.fields(7) = txtPhoneNumber.Text
End If
Call search1
Call search2
If (cmbClass.Text = "GN") Then
If (txtAge.Text < 60) Then
rate = (a2 - a1) * (40 / 100)
Else
rate = (a2 - a1) * (40 / 100) * (85 / 100)
End If
If (rate < 0) Then
rate = -(rate)
End If
rs.fields(6) = rate
End If
If (cmbClass.Text = "SC") Then
If (txtAge.Text < 60) Then
rate = (a2 - a1) * (50 / 100)
Else
rate = (a2 - a1) * (50 / 100) * (85 / 100)
End If
If (rate < 0) Then
rate = -(rate)
End If
rs.fields(6) = rate
End If
If (cmbClass.Text = "FC") Then
If (txtAge.Text < 60) Then
rate = (a2 - a1) * (60 / 100)
Else
rate = (a2 - a1) * (60 / 100) * (85 / 100)
End If
If (rate < 0) Then
rate = -(rate)
End If
rs.fields(6) = rate
End If
If (cmbClass.Text = "AC") Then
If (txtAge.Text < 60) Then
rate = (a2 - a1) * (70 / 100)
Else
rate = (a2 - a1) * (70 / 100) * (85 / 100)
End If
If (rate < 0) Then
rate = -(rate)
End If
rs.fields(6) = rate
End If
rs.Update
NameReserve = txtName.Text
AgeReserve = txtAge.Text
SexReserve = sx
StReserve = txtSource.Text
DestReserve = txtDestn.Text
classReserve = cmbClass.Text
StatusReserve = "Waiting List"
iResponse = MsgBox(StatusReserve, vbOKOnly + vbInformation, "WAIT")
If (iResponse = vbOK) Then
frmRESERVATION.Hide
frmTicket.Show
End If
Exit Sub
Else
MsgBox "Sorry ! ! ! No Reservation Available ", vbOKOnly + vbCritical, "TRY
LATER"
Exit Sub
End If
Exit Sub
Exit Sub
Exit Sub
Exit Sub
Exit Sub
Errorhandler1:
MsgBox "Enter Proper Data", vbOKOnly + vbCritical, "IMPROPER DATA"
End Sub
Cancellation
Exit Sub
End If
If (x2 = 1) Then
Response = MsgBox("Valid PNR - Are you sure to Cancel Ticket ?", vbYesNo +
vbInformation + vbDefaultButton1, "SUCCESS")
Else
MsgBox "Enter valid PNR - Check characters 7 to 12 ", vbOKOnly + vbCritical,
"RETRY"
Exit Sub
End If
If (Response = vbYes) Then
finestring = fine
finestring = "Cash Refund = " + finestring
Response = MsgBox((finestring), vbOKOnly + vbInformation, "REFUND")
End If
If (Response = vbOK) Then
rs.Delete
rs.MoveNext
Response = MsgBox("TICKET CANCELLED SUCCESSFULLY !!!", vbOKOnly +
vbInformation + vbDefaultButton1, "SUCCESS")
End If
If (Response = vbOK) Then
txtPNR1.Text = ""
txtPNR2.Text = ""
txtPNR1.SetFocus
End If
End If
End Sub
Status
statname = rs2.fields(1)
statage = rs2.fields(2)
statsex = rs2.fields(3)
statstart = rs2.fields(4)
statdestn = rs2.fields(5)
stattrainno = Left(txtPNR1, 4)
statPNR = rs2.fields(0)
Exit Sub
Else
flag = 0
status = status + 1
rs2.MoveNext
End If
Loop
Exit Sub
z: MsgBox "Enter proper data", vbOKOnly + vbCritical, "RETRY"
End Sub
rs4.MoveFirst
Do Until (rs4.EOF)
If (rs4.fields(0) = inp) Then
c = rs4.fields(7)
Exit Do
Else
rs4.MoveNext
End If
Loop
End If
Else
rs3.MoveNext
End If
Loop
If (c = "0") Then
MsgBox "Sorry No Phone-number entered", vbOKOnly + vbCritical, "NOT FOUND"
Else
MsgBox c
c = "Phone Number is " + c
MsgBox c, vbOKOnly, vbInformation, "FOUND"
End If
Exit Sub
Exit Sub
z: MsgBox "Invalid PNR", vbOKOnly + vbCritical, "ERROR"
End Sub
Administrator Coding
Add Train
k = txtTrainno
k1 = txttrainname
rs.MoveFirst
Do Until rs.EOF
rs.MoveNext
Loop
If (flag = 1) Then
MsgBox "The Train Number already exists ! Please specify another ", vbOKOnly +
vbCritical, "RETRY"
Exit Sub
ElseIf (flag1 = 1) Then
MsgBox "The Train Name already exists ! Please specify another ", vbOKOnly +
vbCritical, "RETRY"
Exit Sub
Else
p = MsgBox("Availability Check Successful - Want to create table ", vbYesNo +
vbInformation, "SUCCESS")
End If
Set rs = Nothing
If (p = vbYes) Then
cmdEnter1.Visible = True
lblStstn.Visible = True
txtststn.Visible = True
txtsttime.Visible = True
cmdHelp.Visible = True
txttrainname.Locked = True
txtTrainno.Locked = True
txtststn.SetFocus
Else
MsgBox "No table will be created", vbOKOnly + vbCritical, "RETRY"
Exit Sub
End If
If (Len(txtTrainno) < 5) Then ' Code for combining zeros start here
zeros = Len(txtTrainno)
End If
If (zeros = 1) Then
k2 = "000" + txtTrainno
End If
If (zeros = 2) Then
k2 = "00" + txtTrainno
End If
If (zeros = 3) Then
k2 = "0" + txtTrainno
End If
If (zeros = 4) Then
k2 = txtTrainno
End If ' Code for combining zeros ends here
Call addtraindetails
Set rs = Nothing
Set td = db.CreateTableDef(k2)
Set fields(0) = td.CreateField("Station_Name", dbText)
td.fields.Append fields(0)
td.fields.Append fields(1)
td.fields.Append fields(2)
With oindex
.Name = "KilometresIndex"
.fields.Append .CreateField("Kilometres")
.Primary = True
End With
td.Indexes.Append oindex
Set rs = Nothing
Set td = Nothing
Set oindex = Nothing
Set dbindex = Nothing
Call adduserdata
End Sub
Private Sub addtraindetails() ' Add data in a row to TrainDetails (No+Name)
Set rs = db.OpenRecordset("TrainDetails")
On Error GoTo z1
rs.AddNew
rs.fields(0) = k2
rs.fields(1) = k1
rs.Update
Exit Sub
z1: MsgBox "Enter proper data ", vbOKOnly + vbCritical, "RETRY"
End Sub
On Error GoTo z2
rs.AddNew
rs.fields(0) = txtststn
rs.fields(1) = txtsttime
rs.fields(2) = 0
rs.Update
cmdEnter1.Visible = False
lblStstn.Visible = False
txtststn.Visible = False
txtsttime.Visible = False
lblEnterStation.Visible = True
lblEnterTime.Visible = True
lblEnterDistance.Visible = True
txtStnname.Visible = True
txtTime.Visible = True
txtDistance.Visible = True
cmdviewdata.Visible = True
cmdNext.Visible = True
txttrainname.Locked = True
txtTrainno.Locked = True
txtStnname.SetFocus
Set rs = Nothing
Exit Sub
z2: MsgBox "Enter proper data ", vbOKOnly + vbCritical, "RETRY"
End Sub
Private Sub adduserdata()
nw = k2
k2 = k2 + "AC" 'Train's AC table construction starts
Set td = db1.CreateTableDef(k2)
td.fields.Append fields(6)
Set fields(7) = td.CreateField("Phone_Number", dbText)
td.fields.Append fields(7)
With fields(8)
.Attributes = .Attributes Or dbAutoIncrField
End With
td.fields.Append fields(8)
With oindex
.Name = "StatusIndex"
.fields.Append .CreateField("Status")
.Primary = True
End With
td.Indexes.Append oindex
db1.TableDefs.Append td
Set td = Nothing
Set oindex = Nothing
Set dbindex = Nothing 'Train's AC table construction ends
k2 = nw 'restore value of k2
With fields(8)
.Attributes = .Attributes Or dbAutoIncrField
End With
td.fields.Append fields(8)
With oindex
.Name = "StatusIndex"
.fields.Append .CreateField("Status")
.Primary = True
End With
td.Indexes.Append oindex
db1.TableDefs.Append td
Set td = Nothing
Set oindex = Nothing
Set dbindex = Nothing 'Train's FC table construction ends
k2 = nw 'restore value of k2
With fields(8)
.Attributes = .Attributes Or dbAutoIncrField
End With
td.fields.Append fields(8)
With oindex
.Name = "StatusIndex"
.fields.Append .CreateField("Status")
.Primary = True
End With
td.Indexes.Append oindex
db1.TableDefs.Append td
Set td = Nothing
Set oindex = Nothing
k2 = nw 'restore value of k2
With fields(8)
.Attributes = .Attributes Or dbAutoIncrField
End With
td.fields.Append fields(8)
With oindex
.Name = "StatusIndex"
.fields.Append .CreateField("Status")
.Primary = True
End With
td.Indexes.Append oindex
db1.TableDefs.Append td
Set td = Nothing
Set oindex = Nothing
Set dbindex = Nothing 'Train's GN table construction ends
End Sub
rs.fields(1) = txtTime
rs.fields(2) = txtDistance
rs.Update
txtStnname = ""
txtTime = ""
txtDistance = ""
txtStnname.SetFocus
Exit Sub
z: MsgBox "Enter proper data ", vbOKOnly + vbCritical, "RETRY"
End Sub
Delete Train
rs.MoveFirst
Do Until rs.EOF
If (p = rs.fields(0)) Then
flag = 1
Exit Sub
End If
rs.MoveNext
Loop
End Sub
Private Sub cmdCheck_Click()
flag = 0
If (Len(txttrainno) < 4) Then
MsgBox "Enter proper Train number ", vbOKOnly + vbCritical, "RETRY"
Exit Sub
End If
p = txttrainno
Set rs = db.OpenRecordset("TrainDetails")
Call check1
If (flag = 1) Then
b = MsgBox("Train number found ! Want to continue?", vbYesNo + vbInformation,
"FOUND")
Else
MsgBox "Enter proper Train number ", vbOKOnly + vbCritical, "RETRY"
Exit Sub
End If
If (b = vbYes) Then
rs.MoveFirst
Do Until rs.EOF
If (rs.fields(0) = p) Then
rs.Delete
rs.MoveNext
Else
rs.MoveNext
End If
Loop
db.TableDefs.Delete p
a = p + "AC"
db1.TableDefs.Delete a
a = p + "FC"
db1.TableDefs.Delete a
a = p + "SC"
db1.TableDefs.Delete a
a = p + "GN"
db1.TableDefs.Delete a
Else
MsgBox "No table will be deleted", vbOKOnly + vbCritical, "RETRY"
End If
End Sub
Edit Train
flag = 0
If (Len(txttrainno) < 4) Then
MsgBox "Enter proper Train number ", vbOKOnly + vbCritical, "RETRY"
Exit Sub
End If
p = txttrainno
Set rs = db.OpenRecordset("TrainDetails")
rs.MoveFirst
Do Until rs.EOF
If (p = rs.fields(0)) Then
flag = 1
End If
rs.MoveNext
Loop
If (flag = 1) Then
b = MsgBox("Train number found ! Want to continue?", vbYesNo + vbInformation,
"FOUND")
Else
MsgBox "Enter proper Train number ", vbOKOnly + vbCritical, "RETRY"
Exit Sub
End If
If (b = vbYes) Then
lblstncd.Visible = True
txtstncd.Visible = True
cmdEnter.Visible = True
txtstncd.SetFocus
txttrainno.Locked = True
End If
End Sub
If (flag = 0) Then
MsgBox "Enter proper Station Code ", vbOKOnly + vbCritical, "RETRY"
Exit Sub
Else
b = MsgBox("Station Code Matches !!! - Want to continue ?", vbYesNo + vbInformation,
"SUCCESS")
End If
If (b = vbYes) Then
lbltimeupd.Visible = True
txtTimeupd.Visible = True
lblDistupd.Visible = True
txtDistupd.Visible = True
lblStnupd.Visible = True
txtstnupd.Visible = True
cmdGenerate.Visible = True
txtstnupd.SetFocus
txtstncd.Locked = True
End If
End Sub
Set rs = db.OpenRecordset("TrainDetails")
rs.MoveFirst
Do Until rs.EOF
If (rs.fields(0) = p) Then
x = rs.fields(1)
Exit Do
Else
rs.MoveNext
End If
Loop
lblTrainname.Caption = x
lblStncode.Visible = True
lblTime.Visible = True
lblDistance.Visible = True
cmdGenerate.Visible = False
Set rs = Nothing
Set rs = db.OpenRecordset(p)
rs.MoveFirst
Do Until rs.EOF
LstStationIndex.AddItem (((rs.fields(0) & " --------> ")) & (rs.fields(1) & "
---------> ")) & (rs.fields(2))
rs.MoveNext
Loop
LstStationIndex.Visible = True
lblTrainname.Visible = True
lblStnDetails.Visible = True
lblTrainnumber.Visible = True
lblTrainnumber.Caption = p
Else
MsgBox "Train Time Table Updated", vbOKOnly + vbInformation, "RTS"
cmdGenerate.Visible = False
End If
Exit Sub
z1: MsgBox "Enter proper data ", vbOKOnly + vbCritical, "RETRY"
End Sub
Edit Station
If (flag = 1) Then
b = MsgBox("Station Code found ! Want to continue?", vbYesNo + vbInformation,
"FOUND")
Else
MsgBox "Enter proper Station Code ", vbOKOnly + vbCritical, "RETRY"
Exit Sub
End If
If (b = vbYes) Then
txtstncd.Locked = True
lblstncode.Visible = True
lblstnname.Visible = True
txtstnname.Visible = True
txtstncode.Visible = True
cmdEnter.Visible = True
txtstncode.SetFocus
End If
End Sub
cmdEnter.Visible = False
lblstncde.Visible = True
lblstnnme.Visible = True
LstEditStations.Visible = True
rs.MoveFirst
Do Until rs.EOF
rs.MoveNext
Loop
Else
MsgBox "No View will be displayed ", vbOKOnly + vbCritical, "RTS"
txtstncode.Locked = True
txtstnname.Locked = True
cmdEnter.Visible = False
End If
Exit Sub
z1: MsgBox "Enter proper Data ", vbOKOnly + vbCritical, "RETRY"
End Sub
View Stations
rs.MoveFirst
Do Until rs.EOF
Loop
End Sub
View Train
flag = 0
If (Len(txttrainno) < 4) Then
MsgBox "Enter proper Train number ", vbOKOnly + vbCritical, "RETRY"
Exit Sub
End If
p = txttrainno
Set rs = db.OpenRecordset("TrainDetails")
Do Until rs.EOF
If (p = rs.fields(0)) Then
flag = 1
x = rs.fields(0)
y = rs.fields(1)
End If
rs.MoveNext
Loop
If (flag = 1) Then
b = MsgBox("Train number found ! Want to continue?", vbYesNo + vbInformation,
"FOUND")
Else
MsgBox "Enter proper Train number ", vbOKOnly + vbCritical, "RETRY"
Exit Sub
End If
If (b = vbYes) Then
LstStationIndex.Visible = True
lblTrainname.Visible = True
lblStnDetails.Visible = True
lblTrainnumber.Visible = True
txttrainno.Locked = True
lblStncode.Visible = True
lblTime.Visible = True
lblDistance.Visible = True
cmdEdit.Visible = True
cmdCheck.Visible = False
lblTrainnumber.Caption = x
lblTrainname.Caption = y
Set rs1 = db.OpenRecordset(p)
rs1.MoveFirst
Do Until rs1.EOF
LstStationIndex.AddItem (((rs1.fields(0) & " --------> ")) & (rs1.fields(1) & "
---------> ")) & (rs1.fields(2))
rs1.MoveNext
Loop
Else
MsgBox "No View will be displayed ", vbOKOnly + vbCritical, "RETRY"
End If
rs.Close
Set rs = Nothing
End Sub
Account Status
t = txtpass
If (Len(txtpass) < 4) Then
MsgBox "Enter proper password ", vbOKOnly + vbCritical, "RETRY"
Exit Sub
Else
z = MsgBox("Are you sure ,you want to edit operator password? ", vbOKCancel +
vbInformation, "RTS")
End If
If (z = vbOK) Then
s = ((Len(t) / 2))
pk = CInt(s)
pk1 = Len(t) - pk
t1 = Left(t, pk)
t2 = Right(t, pk1)
rs.MoveFirst
rs.Edit
rs.fields(0) = t2
rs.fields(1) = t1
rs.Update
MsgBox "Operator Password Successfully Edited ", vbOKOnly + vbInformation,
"SUCCESS"
Else
MsgBox "Operator Password Not Edited ", vbOKOnly + vbCritical, "RETRY"
End If
End Sub
DFD SYMBOLS
REFERENCES
• http://www.southernrailway.org
• http://www.indianrailways.gov.in
• http://www.irctc.com
CONCLUSION
The project entitled “Railway Ticket System” has been developed to maintain and
manage all the reservation procedures include in the generation of a railway ticket for
senior and non-senior citizens. We believe that, this project will help the computer
operator of Indian Railways (South Zone) to carry out the railway ticket reservation, to
cancel tickets and to implement the newly proposed journey planner without any
difficulties, if this project is implemented in Indian Railways (South Zone). We had tried
our level best to produce the project in its present form.
During the course of the project work, it was found to be very user interactive and
effective than the existing system. The flexible attitude of Visual Basic helps to maintain
the “Railway Ticket System” more effectively.