Click here to Skip to main content
15,896,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Private Sub Combo4_Click()
Dim RES As New ADODB.Recordset
Dim SQL As String
SQL = "SELECT A.*, B.DIV,C.HOUSE FROM STUDENT_RECORD_DATABASE A, DIVISION B,HNM C WHERE A.DIVID = B.DIVID AND A.HID=C.HID AND ROLLNO ='" & Combo4.Text & "'"</pre>
RES.Open SQL, CON, adOpenStatic, adLockOptimistic
    If RES.RecordCount > 0 Then
<pre lang="vb">Combo2.Text = RES!DIV
        Combo9.Text = RES!HOUSE
        'Combo7.Text = RES!DNAME
        'Text9.Text = RES!DCONT
        'Combo8.Text = RES!ANM
        'Text10.Text = RES!DADD

     End If
RES.Close
End Sub


WHEN I RUN THIS CODE RUN-TIME ERROR CAME AS
ORA-00918 ERROR COLUMN AMBIGUOUSLY DEFINED
PLEASE HELP
Posted
Updated 18-Dec-12 18:06pm
v2

1 solution

Most likely two or more of your tables contain a column named ROLLNO so define the table alias for it.

For example if the correct table is STUDENT_RECORD_DATABASE then the query could liike like
SQL
SELECT A.*, B.DIV,C.HOUSE FROM STUDENT_RECORD_DATABASE A, DIVISION B,HNM C WHERE A.DIVID = B.DIVID AND A.HID=C.HID AND a.ROLLNO
 
Share this answer
 
Comments
surkhi 19-Dec-12 0:39am    
THANKS ALOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOT
U MAKE MY DAY!!!!!!!!!!!!!
THANK U SO MUCH...................
Wendelius 19-Dec-12 12:47pm    
Glad it helped :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900