USE CASE DIAGRAM
TABLES
Create following Table in ORACLE
Open VB6.0 and Design the Screen and write the following Surce Code
Source Code
New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Form_Load()
con.Open ("Provider=MSDASQL.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=railway")
rs.Open "select * from rrlogin", con, adOpenDynamic, adLockOptimistic
Frame1.Visible = True
Frame2.Visible = False
End Sub
Private Sub LoginButt_Click()
rs.MoveFirst
Do While Not rs.EOF
If Val(Text5) = rs.Fields("id") And Text1.Text = rs.Fields("username") And Text2.Text = rs.Fields("password") Then
MsgBox " Congratulation"
Form2.Show
Else
End If
rs.MoveNext
Loop
End Sub
Private Sub NewUserButt_Click()
Frame2.Visible = True
Frame1.Visible = False
End Sub
Private Sub SubmitButt_Click()
If con.State = 1 Then con.Close
con.Open ("Provider=MSDASQL.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=railway")
con.Execute ("insert into rrlogin values(" & Text6.Text & ",'" & Text3.Text & "','" & Text4.Text & "')")
MsgBox ("Login Created Successfully")
Text3 = ""
Text4 = ""
Frame2.Visible = False
Frame1.Visible = True
End Sub
Private Sub Text5_LostFocus()
rs.MoveFirst
Do While Not rs.EOF
If rs.Fields("id") = Val(Text5) Then
Text1.Text = rs.Fields("username")
End If
rs.MoveNext
Loop
End Sub
Screen Design
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Command1_Click()
If con.State = 1 Then con.Close
con.Open ("Provider=MSDASQL.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=railway")
con.Execute ("insert into tdetails values(" & Combo1.Text & ",'" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "')")
MsgBox (" Successfully")
End Sub
Private Sub Command2_Click()
Form3.Show
End Sub
Private Sub DISP_BUTT_Click()
rs.MoveFirst
Do While Not rs.EOF
If rs.Fields(0) = Combo1.Text Then
Text1.Text = rs.Fields(1)
Text2.Text = rs.Fields(2)
Text3.Text = rs.Fields(3)
Text4.Text = rs.Fields(4)
End If
rs.MoveNext
Loop
Command2.Visible = True
End Sub
Private Sub Form_Load()
con.Open ("Provider=MSDASQL.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=railway")
rs.Open "select * from tdetails", con, adOpenDynamic, adLockOptimistic
Command2.Visible = False
Command1.Visible = False
Combo1.AddItem ("2601")
Combo1.AddItem ("2602")
Combo1.AddItem ("2651")
Combo1.AddItem ("2652")
Combo1.AddItem ("2221")
Combo1.AddItem ("2222")
Combo1.AddItem ("2631")
Combo1.AddItem ("2632")
End Sub
Screen Design
Source Code
Dim rs As New ADODB.Recordset
Private Sub Command1_Click()
If con.State = 1 Then con.Close
con.Open ("Provider=MSDASQL.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=railway")
con.Execute ("insert into tdetails values(" & Combo1.Text & ",'" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "')")
MsgBox (" Successfully")
End Sub
Private Sub Command2_Click()
Form3.Show
End Sub
Private Sub DISP_BUTT_Click()
rs.MoveFirst
Do While Not rs.EOF
If rs.Fields(0) = Combo1.Text Then
Text1.Text = rs.Fields(1)
Text2.Text = rs.Fields(2)
Text3.Text = rs.Fields(3)
Text4.Text = rs.Fields(4)
End If
rs.MoveNext
Loop
Command2.Visible = True
End Sub
Private Sub Form_Load()
con.Open ("Provider=MSDASQL.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=railway")
rs.Open "select * from tdetails", con, adOpenDynamic, adLockOptimistic
Command2.Visible = False
Command1.Visible = False
Combo1.AddItem ("2601")
Combo1.AddItem ("2602")
Combo1.AddItem ("2651")
Combo1.AddItem ("2652")
Combo1.AddItem ("2221")
Combo1.AddItem ("2222")
Combo1.AddItem ("2631")
Combo1.AddItem ("2632")
End Sub
Screen Design
Source Code
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Private Sub Combo1_Click()
' Data retrive from tdetails Table
rs1.MoveFirst
Do While Not rs1.EOF
If rs1.Fields(0) = Combo1.Text Then
Text1.Text = rs1.Fields(1)
Text2.Text = rs1.Fields(2)
Text3.Text = rs1.Fields(3)
Text4.Text = rs1.Fields(4)
End If
rs1.MoveNext
Loop
End Sub
Private Sub Form_Load()
con.Open ("Provider=MSDASQL.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=railway")
rs.Open "select * from booking", con, adOpenDynamic, adLockOptimistic
rs1.Open "select * from tdetails", con, adOpenDynamic, adLockOptimistic
Combo1.Clear
rs1.MoveFirst
Do While Not rs1.EOF
Combo1.AddItem (rs1.Fields(0))
rs1.MoveNext
Loop
Text6.Visible = False
End Sub