none
ADO Recordset giving null values despite sql containing values for all fields /Oracle 11g/Win7 RRS feed

  • Question

  • Hi ,

    I am faing a very weird issue , i am running a sql using the ADO recordset , but i get only one column value in the recordset.

    Other columns values are coming as Null.

    Using as below :

    --------------------------------------------------------------------------------------------

    Set objConnection=Createobject("ADODB.Connection")

    'connection String and query
    strConnString="Provider=OraOLEDB.Oracle.1;Data Source=<DBNAME>;User ID=<UNAME>;Password=<PSWD>;"

    'Establishing connection with DB
    objConnection.Open strConnString

    sql="select t1.colum1,t2.column2,t1.column3 from table t1,table t2 where t1.id=t2.id(+)"'sample sql


    Set rs= Createobject("ADODB.Recordset")
    rs.Open sql,strConnString

    msgbox rs.GetString()

    'rs.MoveFirst
    'msgbox rs(0).value
    'msgbox rs(1).value

    --------------------------------------------------------------------------------------------

    so , In the above code i am only getting the value for t2.column2 .

    It doesnt matter if i use GetString() or GetRows() or iterate throught the recordset.If i run the query in Toad or any SQLPLUS i am getting values for all the column in the select clause.

    Can anybody help with a solution here?

    Tuesday, August 13, 2013 7:39 AM