ADO 2.8 and Compatibility mode

If you have old code, that access Sql Server through MS-ADO 2.8, you can have some trouble if connect to DB on Sql Server 2016 with compatibility mode do 2016 (130). You can experience some random error on update:

Row cannot be located for updating. Some values may have been changed since it was last read.

The error is absolutely random. On the same table one row update go, the next no.

The only solution is to set compatibility level to 2014 (120) or 2012 (110).

Another solution to the problem: use Provider=MSOLEDBSQL.1 instead of Provider=SQLNCLI11.1 in connection string. With Sql Native Client provider there is a problem with row update, with the new Microsoft OLE DB Driver for SQL Server there is no problem.


Pubblicato

in

da