Building a ADO Recordset with Code



Hi All,

I have a ADO Recordset and I am looping through the fields of an original
recordset to create another one, however the Attributes property doesn't
seem to be created on the new record set (rs). Any ideas?

Here is the code:
'grs' is the Original Recordset

Dim fld as adodb.Field

Set rs = Nothing
rs.CursorLocation = adUseClient
For Each fld In grs.Fields
rs.Fields.Append fld.Name, fld.Type, fld.DefinedSize, fld.Attributes
Next


If I do a debug routine to see the values of the recordset they are all set
to 0. Something like this:

For Each fld In rs.Fields
Debug.Print fld.Name; fld.Attributes;
Next



TIA

Tim


.



Relevant Pages