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