Experiment No.
4
Flight Reservation System
Problem Def: -
To make a mini-project for flight reservation system using Visual Basic 6.0
(VB6) and MS Access/Oracle.
Software Requirement Specification: -
Purpose: -
To make a flight reservation system to book and display the ticket.
Constraints: -
(a) Available tickets should be more than no. of tickets to be booked.
(b) Date of travel should be greater than current date.
Scope: -
To make the flight reservation system to be automated and easily
accessible.
Hardware Requirement: -
Processor Type : Pentium -IV
Speed : 2.4 GHZ
Ram : 128 MB RAM
Hard disk : 20 GB HD
Software Requirement: -
Operating System : Win2000/Win xp
Programming Package : Microsoft Visual Basic 6.0
MS Access / Oracle
Existing System: -
(a) Lots of paper work are involve and is not automated.
Proposed System: -
The Proposed System will have automated ticket booking and seat
allocation.
System Design: -
Use-Case Diagram: -
Flight Reservation System
Get Account
User Login
Choose the
destination
Admin
User
Select a flight
Book the ticket
Data Flow Diagram: -
Invalid user
Invalid user
login
login
Request for flight
Check
availability
Found
Ticket book
Request to book ticket
Ticket booked
Activity Diagram: -
User
Search for flight Cancel a ticket
Availability of Required no. of Enter ticket ID Cancel and
flights tickets refund
Tickets booked and Database updated
database updated
Terminate
FORM 1():
Private Sub Command1_Click()
Unload Me
Form2.Show
End Sub
Private Sub Command2_Click()
Unload Me
Form3.Show
End Sub
Private Sub Command3_Click()
Unload Me
Form4.Show
End Sub
FORM 2():
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Command3_Click()
Form1.Show
Unload Me
End Sub
Private Sub Command4_Click()
If Text1.Text <> "" Then
If cn.State = adStateOpen Then
cn.Close
End If
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open "C:\Documents and Settings\aarthi\Software Engineering\Railway.mdb"
cn.CursorLocation = adUseClient
rs.Open "select seat from train where num=" + Text1.Text, cn, adOpenKeyset, adLockOptimistic
Set DataGrid1.DataSource = rs
End If
End Sub
FORM 3():
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Command1_Click()
If Text1.Text <> "" And Text2.Text <> "" And Text3.Text <> "" And Text4.Text <> "" And Text5.Text <> ""
Then
If cn.State = adStateOpen Then
cn.Close
End If
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open "C:\Documents and Settings\aarthi\Software Engineering\Railway.mdb"
rs.Open "select * from passenger", cn, adOpenKeyset, adLockOptimistic
rs.AddNew
rs.Fields(0) = Text1.Text
rs.Fields(1) = Text2.Text
rs.Fields(2) = Text3.Text
rs.Fields(3) = Text4.Text
rs.Fields(4) = Text5.Text
rs.Update
rs.Close
rs.Open "delete from train where num=" + Text1.Text + " and seat=" + Text4.Text, cn, adOpenKeyset,
adLockOptimistic
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
End Sub
Private Sub Command3_Click()
Unload Me
Form1.Show
End Sub
FORM 4():
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Command1_Click()
If Text1.Text <> "" Then
If cn.State = adStateOpen Then
cn.Close
End If
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open "C:\Documents and Settings\aarthi\Software Engineering\Railway.mdb"
rs.Open "select * from passenger where pnr=" + Text1.Text, cn, adOpenKeyset, adLockOptimistic
Dim a As Integer
Dim b As Integer
a = rs.Fields(0)
b = rs.Fields(3)
rs.Close
rs.Open "delete * from passenger where pnr=" + Text1.Text, cn, adOpenKeyset, adLockOptimistic
rs.Open "select * from train", cn, adOpenKeyset, adLockOptimistic
rs.AddNew
rs.Fields(0) = a
rs.Fields(1) = b
rs.Update
rs.Close
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
End Sub
Private Sub Command3_Click()
Unload Me
Form1.Show
End Sub
Private Sub Form_Load()
If cn.State = adStateOpen Then
cn.Close
End If
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open "C:\Documents and Settings\aarthi\Software Engineering\Railway.mdb"
cn.CursorLocation = adUseClient
rs.Open "select * from passenger", cn, adOpenKeyset, adLockOptimistic
Set DataGrid1.DataSource = rs
End Sub
4.0 SAMPLE FORMS
TITLE FORM
RESERVATION FORM
CANCELLATION FORM
5.0 RESULT
Thus the online Railway Reservations System was implemented using the specified front
end and back end tools.