General information
Category:
COM/DCOM and OLE Automation
I added .Cursortype = 3 (adOpenStatic) before opening the recordset and then tried to update an identity field (SQL Server) with .Fields(0).Value = 1111, which gave an error "Multiple step.. generated errors" and a status code of 9 (adFieldPermissionDenied) for that field.
I have MDAC 2.6.
>The last constraint I tested this with was in a varchar field (length 1) only allowing the letter 'A' in to the table. I know the constraint is firing because the error -2147217873 is a constraint error. Thanks for the pointer to the cursortype. I have changed this to KeySet with no difference. Could I see the changes you made. This may sort the problem
>
>Thanks Again
>
>Gerry
>
>
>>What is the constraint on the fields? I ask this because the error might not be related to field constraints. Check in what line the code is raising the error.
>>
>>Another thing I notice is that you should have a static or keyset cursor for batch updates, as explained in the help for the UpdateBatch method. The way you have your code you are opening a forward only cursor.
>>
>>I tested some of your code and after adding the appropriate cursor type setting before opening the RS the status field does return the corresponding constant.
>>
>>>>>In further inspection, the Status property does get populated in this circumstance. This property should return 11 (adFieldSchemaViolation) for the offending field object.
>>>>>
>>>>>Can you post more details as to how you are checking the status field?
>>>>
>>>>I mean status property.
>>>
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only