S
Sandeep Limaye
Hi,
Is there any way that I can add multiple columns with the _same name_ into
the Fields collection of an ADO recordset? I am fetching data into an
OracleDataReader through the usage of ODP.NET, and I want to create and
populate a Recordset from it to be returned to my COM clients.
At present, for a query such as "SELECT id, id from table1" the
OracleDataReader does contain two columns with the same name "id", but when
I try to populate the fields collection of a recordset, while inserting the
second column using Append() method, it gives the following error:
<snip>
Object is already in collection. Cannot append. at
ADODB.Fields.Append(String Name, DataTypeEnum Type, Int32 DefinedSize,
FieldAttributeEnum Attrib, Object FieldValue) at
ADODB.InternalFields.Append(String Name, DataTypeEnum Type, Int32
DefinedSize, FieldAttributeEnum Attrib, Object FieldValue)
</snip>
MSDN of course says that you can't append two columns with the same name to
the fields collection. But when I run the same query directly using MS ADO
and OleDb, the recordset returned to me _does_ contain two columns with the
same name. Is there anything that I am missing, or any special flags that
need to be set to allow for such duplicate column names?
Thanks in advance,
Sandeep
Is there any way that I can add multiple columns with the _same name_ into
the Fields collection of an ADO recordset? I am fetching data into an
OracleDataReader through the usage of ODP.NET, and I want to create and
populate a Recordset from it to be returned to my COM clients.
At present, for a query such as "SELECT id, id from table1" the
OracleDataReader does contain two columns with the same name "id", but when
I try to populate the fields collection of a recordset, while inserting the
second column using Append() method, it gives the following error:
<snip>
Object is already in collection. Cannot append. at
ADODB.Fields.Append(String Name, DataTypeEnum Type, Int32 DefinedSize,
FieldAttributeEnum Attrib, Object FieldValue) at
ADODB.InternalFields.Append(String Name, DataTypeEnum Type, Int32
DefinedSize, FieldAttributeEnum Attrib, Object FieldValue)
</snip>
MSDN of course says that you can't append two columns with the same name to
the fields collection. But when I run the same query directly using MS ADO
and OleDb, the recordset returned to me _does_ contain two columns with the
same name. Is there anything that I am missing, or any special flags that
need to be set to allow for such duplicate column names?
Thanks in advance,
Sandeep