Click to See Complete Forum and Search --> : ADO fields
simonm
Sep 27th, 2000, 06:55 AM
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.
Phil McKracken
Sep 27th, 2000, 07:11 AM
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.
simonm
Sep 27th, 2000, 08:06 AM
You seem to know your stuff. Are you sure you didn't write ADO yourself?
simonm
Sep 27th, 2000, 09:09 AM
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.
Phil McKracken
Sep 27th, 2000, 06:31 PM
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.