Results 1 to 5 of 5

Thread: ADO fields

  1. #1

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

    Angry

    Does anybody know what the values for the 'Status' property of the ADO field object mean?

    There doesn't appear to be any help topic on it (in fact the property list for the field object omitts the 'Status' property) and I don't know what the (integer) values mean.

    Specifically, I wondered what the value of '11' indicated.

    Any ideas, anybody?

    Simon.

  2. #2
    Member
    Join Date
    Aug 2000
    Posts
    32

    Smile Straight outta MSDN

    Status Property (ADO Field)


    Indicates the status of a Field object.

    Return Value

    Returns a FieldStatusEnum value. The default value is adFieldOK.

    Remarks

    This property always returns adFieldOK for fields of a Recordset object.

    Additions and deletions to the Fields collections of the Record object are cached until the Update method is called. The Status property enables you to determine which fields have been successfully added or deleted.

    To enhance performance, schema changes are cached until Update is called, and then the changes are made in a batch optimistic update. If the Update method is not called, the server is not updated. If any updates fail then an error is returned and the Status property indicates the combined values of the operation and error status code. For example, adFieldPendingInsert OR adFieldPermissionDenied. The Status property for each Field can be used to determine why the Field was not added, modified, or deleted. Status is only meaningfully exposed on the Record.Fields collection and not the Recordset.Fields collection.

    Two problems can arise when adding, modifying, or deleting a Field. If the user deletes a Field, it is marked for deletion from the Fields collection. If the subsequent Update returns an error because the user tried to delete a Field for which they do not have permission, the Field will have a status of adFieldPermissionDenied OR adFieldPendingDelete. Calling the CancelUpdate method restores original values and sets the Status to adFieldOK. Similarly, the Update method may return an error because a new Field was added and given an inappropriate value. In that case the new Field will be in the Fields collection and have a status of adFieldPendingInsert and perhaps adFieldCantCreate. You can supply an appropriate value for the new Field and call Update again. Note that calling Resync instead requeries the provider.
    VB 6, SQL, Java, AutoLISP, Avenue and on a good day AML

  3. #3

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

    Thumbs up Thakyou...

    You seem to know your stuff. Are you sure you didn't write ADO yourself?

  4. #4

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

    Question By the way...

    The above was caused because I had A field that was read only (because it was an artifical field).

    Is there anyway to make that field updatable if it's not by default (as in this case)?

    I only want to update it in the (disconnected) recordset and I don't want to attempt an update of the data source. Surely this must be possible but I can't see any way of doing it.

    Simon.

  5. #5
    Member
    Join Date
    Aug 2000
    Posts
    32

    Smile

    Thanks but I copied that answer out of MSDN they know there stuff I just found it. As far as your next question, I don't ave an answer for that. I can check into it tomorrow at work.

    Sorry

    Phil
    VB 6, SQL, Java, AutoLISP, Avenue and on a good day AML

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