Results 1 to 3 of 3

Thread: Making a read-only ADO field updatable

  1. #1

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796
    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?

  2. #2
    Member
    Join Date
    Jan 2000
    Location
    Quantico, VA, USA
    Posts
    41

    Cool

    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
    To err is human, but to apologize frequently is embarassing.

  3. #3

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Talking Hello Chuck

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width