Differing Results between Record binding (C++) and Collect method
-
Hi, I have some code where the dataset being modified is the result of a JOIN between two tables. The key of the first table is also a foreign key of the second table. There will be situations where the fields from the second table will be NULL and others when the alternate key on table two will match the primary key of table one. The record binding code works when the alternate key is not NULL, but when it and the second tables fields are NULL then the UpdateBatch gives the error "Row cannot be located for updating. Some values may have been changed since it was last read." This is not true as this is a) not a multi-user system and b) nothing has changed. I have dumped all the values in the record set - Value, OriginalValue and UnderlyingValue. All the fields of the second table are showing up as NULL for all of the value types. All the other fields values are identical apart from Value for the attribute on the first table being updated. I have status values for all the fields from the second table and they are all set to adFldNull. If I then swap to using the Collect method then no error occurs. The connection has the following properties: Provider = oledb (Server is SQL Server 2000) CursorLocation = adUseClient IsolationLevel = adXactReadCommitted ConnectionMode = adModeRead | adModeWrite | adModeShareDenyRead | adModeShareDenyWrite | adModeShareExclusive The recordset properties are: CursorLocation = adUseClient CursorType = adOpenStatic LockType = adLockBatchOptimistic MarshalOptions = adMarshalModifiedOnly Any ideas other than swapping to using the Collect method?