Railway Reservation System
Railway Reservation System
Railway Reservation System
Researchers
M.RAHUL(171132)
S.KARTHI KEYAN(171121)
VIVEKANANDA COLLEGE
(Residential & Autonomous-A Guru Kula Institute of Life Training)
(Affiliated to Madurai Kamaraj University)
Reaccredited with “A” Grade (CGPA3.59 out of 4.00) by NAAC
THIRUVEDAKAM WEST
MADURAI-625 234.
2019-2020
Dr. M. MOHAN M.com. M.PHIL. PGDCA, D.coop, PhD
Assistant Professor
Department of Commerce (Computer Applications)
Vivekananda College
Triuvedakam West, Madurai - 625 234.
CERTIFICATE
This is to certify that this project work entitled “RAILWAY RESERVE
candidate, it has not been based on the degree, diploma or any other similar course to this
This project report is submitted for the viva voice examination held on
been originally done by me. This work has not been submitted earlier, in full or
Login
End Sub
Me.Hide
MDIForm1.Show
Else
txtPassword.Text = ""
txtPassword.SetFocus
End If
Else
Else
txtUserName = ""
txtPassword = ""
txtUserName.SetFocus
SendKeys "{Home}+{End}"
End If
End If
End Sub
Train Details:
Option Explicit
Adodc.Recordset.CancelUpdate
Adodc.Recordset.MoveFirst
cmdNew.Enabled = True
cmdUpdate.Enabled = True
cmdSave.Enabled = True
cmdFirst.Enabled = True
cmdPrev.Enabled = True
cmdNext.Enabled = True
cmdLast.Enabled = True
txtlock
End Sub
Dim a As Variant
a = MsgBox("Are you sure to Delete this Train Details", vbCritical + vbYesNo, "Delete Train")
If a = vbYes Then
rs.Delete
MsgBox "Deleted"
End If
End Sub
rs.MoveFirst
txtSetFields
End Sub
rs.MoveLast
txtSetFields
End Sub
rs.MoveNext
txtSetFields
End Sub
rs.AddNew
txtClear
cmdNew.Enabled = False
cmdSave.Enabled = True
cmdCancel.Enabled = True
End Sub
rs(0) = txtTrNo.Text
rs(1) = txtTrName.Text
rs(2) = NotAvl.Text
rs(3) = txtSt_stat.Text
rs(4) = txtVia.Text
rs(5) = txtEnd_stat.Text
rs(6) = txtDept_time.Text
rs(7) = txtIIAC.Text
rs(8) = txtIIIAc.Text
rs(9) = txtAcCh.Text
rs(10) = txtICls.Text
rs(11) = txtIICls.Text
rs(12) = txtGen.Text
End Sub
End Sub
Adodc.Recordset.MovePrevious
txtSetFields
End Sub
rs(0) = Val(txtTrNo.Text)
rs(1) = txtTrName.Text
rs(2) = NotAvl.Text
rs(3) = txtSt_stat.Text
rs(4) = txtVia.Text
rs(5) = txtEnd_stat.Text
rs(6) = CDate(txtDept_time.Text)
rs(7) = txtIIAC.Text
rs(8) = txtIIIAc.Text
rs(9) = txtAcCh.Text
rs(10) = txtICls.Text
rs(11) = txtIICls.Text
rs(12) = txtGen.Text
End Sub
Private Sub cmdSave_Click()
puts
rs.Update
MsgBox "Stored"
End Sub
gets
cmdUpdate.Enabled = False
cmdSave.Enabled = True
cmdCancel.Enabled = True
rs.Update
MsgBox "updated"
End Sub
'Call open_database
End Sub
txtTrNo.Text = ""
txtTrName.Text = ""
NotAvl.Text = "-"
txtSt_stat.Text = ""
txtVia.Text = ""
txtEnd_stat.Text = ""
txtDept_time.Text = ""
txtIIAC.Text = "0"
txtIIIAc.Text = "0"
txtAcCh.Text = "0"
txtICls.Text = "0"
txtIICls.Text = "0"
txtGen.Text = "0"
End Sub
cmdPrev.Enabled = False
cmdNext.Enabled = False
Else
txtTrNo.Text = rs.Fields(0).Value
txtTrName.Text = rs.Fields(1).Value
NotAvl.Text = rs.Fields(2).Value
txtSt_stat.Text = rs.Fields(3).Value
txtVia.Text = rs.Fields(4).Value
txtEnd_stat.Text = rs.Fields(5).Value
txtDept_time.Text = rs.Fields(6).Value
txtIIAC.Text = rs.Fields(7).Value
txtIIIAc.Text = rs.Fields(8).Value
txtAcCh.Text = rs.Fields(9).Value
txtICls.Text = rs.Fields(10).Value
txtIICls.Text = rs.Fields(11).Value
txtGen.Text = rs.Fields(12).Value
End If
End Sub
If rs.AbsolutePosition = 1 Then
cmdFirst.Enabled = False
cmdPrev.Enabled = False
cmdNext.Enabled = True
cmdLast.Enabled = True
cmdFirst.Enabled = True
cmdPrev.Enabled = True
cmdNext.Enabled = False
cmdLast.Enabled = False
cmdFirst.Enabled = False
cmdPrev.Enabled = False
cmdNext.Enabled = False
cmdLast.Enabled = False
Else
cmdFirst.Enabled = True
cmdPrev.Enabled = True
cmdNext.Enabled = True
cmdLast.Enabled = True
End If
End Sub
rs.Close
End Sub
Seat Available:
End Sub
'Option Explicit
'TRNO.Text = TRNO.List(0)
txtlock
'Call open_database
TRNO.AddItem (rs(0))
rs.MoveNext
Wend
End Sub
rs.Close
End Sub
rs.Close
MsgBox TRNO.Text
Dim i As Integer
i = CInt(TRNO.Text)
txtSetFields
End Sub
txtTrName.Locked = True
txtIIAC.Locked = True
txtIIIAc.Locked = True
txtAcCh.Locked = True
txtICls.Locked = True
txtIICls.Locked = True
txtGen.Locked = True
End Sub
TRNO.Locked = False
txtTrName.Locked = False
txtIIAC.Locked = False
txtIIIAc.Locked = False
txtAcCh.Locked = False
txtICls.Locked = False
txtIICls.Locked = False
txtGen.Locked = False
End Sub
TRNO.Text = ""
txtTrName.Text = ""
txtIIAC.Text = "0"
txtIIIAc.Text = "0"
txtAcCh.Text = "0"
txtICls.Text = "0"
txtIICls.Text = "0"
txtGen.Text = "0"
End Sub
txtTrName.Text = rs.Fields(1).Value
lblSt_Stat.Caption = rs.Fields(3).Value
lblEnd_Stat.Caption = rs.Fields(5).Value
tim.Caption = rs.Fields(6).Value
txtIIAC.Text = rs.Fields(7).Value
txtIIIAc.Text = rs.Fields(8).Value
txtAcCh.Text = rs.Fields(9).Valu
txtICls.Text = rs.Fields(10).Value
txtIICls.Text = rs.Fields(11).Value
txtGen.Text = rs.Fields(12).Value
End Sub
Passenger Details:
If KeyAscii = 27 Then
Unload Me
End If
End Sub
If KeyAscii = 27 Then
Unload Me
End If
End Sub
Reservation Booking:
KeyAscii = KeyAscii - 32
End If
End Sub
KeyAscii = KeyAscii - 32
End If
End Sub
If KeyAscii = 8 Then
Else
KeyAscii = 0
End If
End If
End Sub
KeyAscii = KeyAscii - 32
End If
End Sub
End If
End Sub
Unload Me
End Sub
'rs1.Close
'rs3.Close
'cn.Close
End Sub
KeyAscii = KeyAscii - 32
End If
End Sub
Else
SEX.Text = ""
SEX.SetFocus
End If
End Sub
rs1.CursorLocation = adUseClient
rs1.Open "select* from station_fare where st_name ='" & st_stat.Text & "' and end_name ='" &
end_stat.Text & "'"
'rs1.Open "select fare from station_fare where st_name='" & St_stat.Text & " ' and end_name='" &
end_stat.Text & "' and class_type='" & Class_type.Text & "'"
'fare.Text = rs1.Fields(0)
rs1.MoveFirst
fare.Text = rs1.Fields(3).Value
couch.Text = "AC-II"
fare.Text = rs1.Fields(4).Value
couch.Text = "AC-III"
'fare.Text = rs1.Fields(5).Value
couch.Text = "Ac-CH"
fare.Text = rs1.Fields(6).Value
couch.Text = "F"
ElseIf Class_Type.Text = "II Class" Then
fare.Text = rs1.Fields(7).Value
couch.Text = "S"
fare.Text = rs1.Fields(8).Value
couch.Text = "Gen"
End If
End Sub
rs3.AddNew
rs3(0) = P_cd.Text
rs3(1) = P_nm.Text
rs3(2) = AGE.Text
rs3(3) = SEX.Text
rs3(4) = TRNO.Text
rs3(5) = tr_name.Text
rs3(6) = dept_tm.Text
rs3(7) = DTPicker1.Value
rs3(8) = st_stat.Text
rs3(9) = end_stat.Text
rs3(10) = Bord_to.Text
rs3(11) = Class_Type.Text
rs3(12) = fare.Text
rs3(13) = couch.Text
rs3(14) = seatNo.Text
rs3.Update
MsgBox "Stored"
'rs.Open
'MsgBox rs1.Fields(7).Value
' Else
' rs1.Source = "update train_details set II_Ac_Seats = " & Val(rs.Fields(7).Value) - 1 & " where
tr_name = " & tr_name.Text
' rs1.Open
' End If
'MsgBox rs.Fields(8).Value
' If rs.Fields(8).Value = 0 Then
' Else
' rs1.Source = "update train_details set III_Ac_Seats = " & Val(rs.Fields(8).Value) - 1 & " where
tr_name = " & tr_name.Text
' rs1.Open
' End If
'MsgBox rs1.Fields(9).Value
' Else
' rs1.Source = "update train_details set Ac_Chair_Seats = " & Val(rs.Fields(9).Value) - 1 & " where
tr_name = '" & tr_name.Text & "'"
' rs1.Open
' End If
'MsgBox rs.Fields(10).Value
' Else
' rs1.Source = "update train_details set I_Class_Seats = " & Val(rs.Fields(10).Value) - 1 & " where
tr_name = " & tr_name.Text
' rs1.Open
' End If
'MsgBox rs.Fields(11).Value
' Else
' rs1.Source = "update train_details set II_Class_Seats = " & Val(rs.Fields(11).Value) - 1 & " where
tr_name = " & tr_name.Text
' rs1.Open
' End If
'MsgBox rs.Fields(12).Value
' Else
' rs1.Source = "update train_details set UnResrv_Seats = " & Val(rs.Fields(12).Value) - 1 & " where
tr_name = " & tr_name.Text
' rs1.Open
' End If
'End If'
'qry = "insert into Passenger_Details values('" & P_cd.Text & "','" & P_nm.Text & "','" & Add1.Text & "','"
_
'& Add2.Text & "','" & City.Text & "','" & pin.Text & "','" & ph.Text & "','" & AGE.Text & "','" _
'qry = "insert into Reservation values('" & P_cd.Text & "','" & P_nm.Text & "','" & AGE.Text &
"','" _
'& SEX.Text & "','" & trno.Text & "','" & tr_name.Text & "','" & dept_tm.Text & "','" & J_dt.Value & "','" _
'& St_stat.Text & "','" & end_stat.Text & "','" & Bord_to.Text & "','" & Class_type.Text & "','" & fare.Text
& "','" & couch.Text & "'," & seatNo.Text & ")"
''cmdSave.Enabled = False'
'rs.Close
End Sub
Call open_database
rs1.MoveFirst
TRNO.Clear
TRNO.AddItem (rs1.Fields(0).Value)
rs1.MoveNext
Wend
rs1.Close
Class_Type.AddItem ("UnReserved")
cmdSave.Enabled = True
txtlock
End Sub
P_cd.Locked = False
tr_name.Locked = True
dept_tm.Locked = True
st_stat.Locked = True
end_stat.Locked = True
fare.Locked = False
couch.Locked = True
End Sub
P_cd.Locked = False
tr_name.Locked = False
dept_tm.Locked = False
st_stat.Locked = False
end_stat.Locked = False
fare.Locked = False
couch.Locked = False
End Sub
P_cd.Text = ""
P_nm.Text = ""
AGE.Text = ""
SEX.Text = ""
Add1.Text = ""
Add2.Text = ""
City.Text = ""
pin.Text = ""
ph.Text = ""
tr_name.Text = ""
dept_tm.Text = ""
st_stat.Text = ""
end_stat.Text = ""
Bord_to.Text = ""
fare.Text = ""
couch.Text = ""
seatNo.Text = ""
End Sub
cmdPrev.Enabled = False
cmdNext.Enabled = False
Else
txtTrNo.Text = rs.Fields(0).Value
txtTrName.Text = rs.Fields(1).Value
NotAvl.Text = rs.Fields(2).Value
txtSt_stat.Text = rs.Fields(3).Value
txtVia.Text = rs.Fields(4).Value
txtEnd_stat.Text = rs.Fields(5).Value
txtDept_time.Text = rs.Fields(6).Value
txtIIAC.Text = rs.Fields(7).Value
txtIIIAc.Text = rs.Fields(8).Value
txtAcCh.Text = rs.Fields(9).Value
txtICls.Text = rs.Fields(10).Value
txtIICls.Text = rs.Fields(11).Value
txtGen.Text = rs.Fields(12).Value
End If
End Sub
Dim k As Integer
k = CInt(TRNO.Text)
tr_name.Text = rs1.Fields(1).Value
st_stat.Text = rs1.Fields(3).Value
end_stat.Text = rs1.Fields(5).Value
dept_tm.Text = rs1.Fields(6).Value
rs1.Close
End Sub
Unload Me
End Sub
Cancel Reservation:
Option Explicit
rs1.Close
rs1.Open "delete from reservation where p_code = '" & P_cd.Text & "'"
'rs2.open "delete from pass_details where p_code = '" & P_cd.Text & "'"
rs1.Source = "update train_details set II_Ac_Seats = " & Val(rs2.Fields(7).Value) + 1 & " where
tr_name = '" & tr_name.Text & "'"
rs1.Open
rs1.Source = "update train_details set III_Ac_Seats = " & Val(rs2.Fields(8).Value) + 1 & " where
tr_name = " & tr_name.Text
rs1.Open
ElseIf Class_type = "Ac Chair" Then
rs1.Source = "update train_details set Ac_Chair_Seats = " & Val(rs2.Fields(9).Value) + 1 & " where
tr_name = '" & tr_name.Text & "'"
rs1.Open
rs1.Source = "update train_details set I_Class_Seats = " & Val(rs2.Fields(10).Value) + 1 & " where
tr_name = " & tr_name.Text
rs1.Open
rs1.Source = "update train_details set II_Class_Seats = " & Val(rs2.Fields(11).Value) + 1 & " where
tr_name = " & tr_name.Text
rs1.Open
rs1.Source = "update train_details set UnResrv_Seats = " & Val(rs2.Fields(12).Value) + 1 & " where
tr_name = " & tr_name.Text
rs1.Open
End If
cmdCancel.Enabled = False
End Sub
Unload Me
End Sub
Private Sub Form_Load()
'Call open_database
'rs1.Close
rs1.MoveFirst
P_cd.Clear
P_cd.AddItem (rs1.Fields(0).Value)
rs1.MoveNext
Wend
cmdCancel.Enabled = True
rs1.Close
End Sub
rs1.Open "select * from reservation where p_code = '" & P_cd.Text & "'"
P_nm.Text = rs1(1)
AGE.Text = rs1(2)
SEX.Text = rs1(3)
trno.Text = rs1(4)
tr_name.Text = rs1(5)
dept_tm.Text = rs1(6)
end_stat.Text = rs1(9)
Bord_to.Text = rs1(10)
Class_type.Text = rs1(11)
fare.Text = rs1(12)
couch.Text = rs1(13)
seatNo.Text = rs1(14)
End Sub
BIBILOGRAPHY
Books
Mastering in Visual Basic 6.0
- Even Gelo Petroutsos
Programming in Visual Basic 6.0
- Htozer
Murchis Visual Basic 6.0
- Edloop, Anne Prince, Joel Murach
4. Introduction to MS-Access
- Nancy Greeberg
- Priya Nathan
WEBSITES
MICROSOFT VISUAL BASIC 6.0
www.visualbasic/(S(pdfrohu0ajmwt445fanvj2r3))/learn/data-access/
www.w3schools.com/vb/default.asp
www.411visualbasic /home/sites
www.cristiandarie.ro/vb-tutorial/
Www. visualbasic -tutorials.com/basics/first-website/
MS ACCESS
www.functionx.com/msaccess/
www.technet.microsoft.com/en-us/library/ msaccess69620.aspx
www.msdn.microsoft.com/en-us/library/ms169620(msaccess).aspx
www.softwaretrainingtutorials.com/ms- access -2005.php