PDA

Click to See Complete Forum and Search --> : Making a read-only ADO field updatable


simonm
Sep 27th, 2000, 09:02 AM
If I have a read-only field in a disconnected recordset, how can I make it not read-only?

I don't want to update the data source (As I know I can't) but I want to update the field in the recordset nether the less.

When I try, I get RT error -2147217887: "Multiple step operation generated errors. Check each status value"

The field status = 11 (adFieldSchemaViolation).

Any ideas anyone?

Chuck Sweet
Sep 27th, 2000, 09:35 AM
so you want the rs to reflect changes, but not to modify the datasource? hmm...it's not going to work disconnected (i don't think...i'm sure someone will correct me if i'm wrong). i think one of the options you can open it with has some effect.

why don't you open it up again using the adLockBatchOptimistic. That way, when you finish playing with the data, you can use the CancelBatch or UpdateBatch methods to discard or save the changes. I'm not sure exactly how this works, but it sounds like what you need.

luck

-chuck

simonm
Sep 27th, 2000, 10:10 AM
Unfortunately, I have already opened my recordset in adLockBatchOptimistic mode but the error I get is not when I attempt to update the recordset, but rather when I actually assign a value to the read only field.

It's becuase ADO knows this field can never update the data source (it doesn't exist) that it flags the field as non-updatable. All I want to do is overide this field's status and assign a value to it (even though I know it will be lost after a .Resync).

Thanks anyway,

Simon.