Results 1 to 14 of 14

Thread: accesiing data from database...

Threaded View

  1. #6

    Thread Starter
    Member
    Join Date
    Sep 2010
    Posts
    33
    Code:
    Private Sub Form_Load()
    con.ConnectionString = "Provider=Microsoft.Jet.oledb.4.0;Data Source=" & App.Path & " \AirLines.mdb"
    con.Open
    rs.Open "Select * from Flight_Details order by SrNo", con, adOpenDynamic
    Filling
    Values
    
    end sub
    ----------------------------------------------------------
    
    
    Sub Values()
    Dim i
    If rs2.State = 1 Then rs2.Close
    rs2.Open "Select max(SrNo) from Flight_Details ", con
    i = rs2.Fields(0) + 1
    If rs.EOF = True Or rs.BOF = True Then
        If txtsr.Text < i Then
            MsgBox "Class Not Found", vbInformation, "Airlines"
            cmbclasscode.SetFocus
        Else
        End If
            Exit Sub
    End If
    txtsr.Text = rs.Fields(4)
    txtcode.Text = rs.Fields(0)
    txtfare.Text = rs.Fields(2)
    txtseats.Text = rs.Fields(3)
    If rs1.State = 1 Then rs1.Close
    rs1.Open "Select Airline_name from Airlines_Master where Aircode ='" & Mid$(rs.Fields(0), 1, 2) & "'"
    txtflight.Text = UCase(rs1.Fields(0))
    cmbnum.Text = Mid$(rs.Fields(0), 3, 4)
    cmbcode.Text = Mid$(rs.Fields(0), 1, 2)
    If rs1.State = 1 Then rs1.Close
    rs1.Open "Select ClassName from Class_Master where ClassCode='" & rs.Fields(1) & "'", con
    If rs1.EOF = True Or rs1.BOF = True Then
    MsgBox "No Records To Display", vbInformation, "Airlines"
    Exit Sub
    End If
    cmbclasscode.Text = UCase(rs1.Fields(0))
    i written this code but it shows some error....

    like sub or function not defined this is the errror i got during compilation.....
    Last edited by si_the_geek; Oct 3rd, 2010 at 08:19 AM. Reason: was needlessly spread across 3 posts

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width