Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Constraint Error Handling with ADO and SQL
Message
From
18/06/2001 14:35:05
 
 
To
18/06/2001 12:38:40
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00519999
Message ID:
00520707
Views:
15
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
Map
View

Click here to load this message in the networking platform