How to retrieve data from oracle database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wayne rooney

    #1

    How to retrieve data from oracle database

    for a student database consisting of 2 attributes id and marks.i am inputting id from one text box.i want the marks of that particular id retrieved from oracle database into another text box.

    Code:
    Private Sub Command1_Click()
    
    rs.Open "stud", cn, adOpenStatic, adLockBatchOptimistic
    rs.MoveFirst
    
    
    For i = 0 To (rs.RecordCount - 1)
    
    rs.Open ("select marks from stud where id=('" & Val(Text3.Text) & "')"), cn, adOpenStatic
    
    Text2.Text = rs(1)
    rs.Close
    
    rs.Close
    Exit For
    Next
    
    End Sub
    Last edited by MMcCarthy; Oct 17 '10, 09:31 PM. Reason: added code tags
Working...