tags:

views:

665

answers:

1

I there a simple way to append a new field to an existing open ADO RecordSet?

fields.append() won't work if the RecordSet is open, and closing appears to kill the existing data.

NB: I'm using Microsoft ActiveX DataObject 2.8 Library

+2  A: 

You can't append fields to a recordset while it's open.

You can create a clone of the recordset, append your required fields, open it and copy the data from the original.

The other option is to persist the recordset as xml, modify the rowset schema, add required fields & then load xml into a new recordset.

Mitch Wheat
Thanks Mitch. When you say Clone i'm assuming you mean iterate through fields() rather than using rs.clone. Is that correct? From memory rs.clone only creates a pointer to your original recordset.
Mark Nold