Microsoft KB Archive/192652

From BetaArchive Wiki
Knowledge Base


Article ID: 192652

Article Last Modified on 12/3/2003



APPLIES TO

  • Microsoft OLE DB Provider for ODBC 1.5
  • Microsoft OLE DB Provider for ODBC 2.0
  • Microsoft Data Access Components 2.5
  • Microsoft Data Access Components 2.6
  • Microsoft Data Access Components 2.7



This article was previously published under Q192652

SYMPTOMS

When attempting an ActiveX Data Objects (ADO)/ Remote Data Services (RDS) update, using the OLEDB provider for ODBC (MSDASQL) with a third party ODBC driver, you may receive an error.

CAUSE

The error results from the third party ODBC driver not supporting positioned updates, for example SQLSetPos(). This behavior does not occur with the Microsoft ODBC driver because it does support positioned updates.

RESOLUTION

A workaround for this error is to use searched updates, which are described in the ODBC 3.0 Programmer's Reference book. To force searched updates with ODBC you can add a WHERE clause to the SELECT statement that forces ODBC to simulate positioned updates. Additional ODBC calls are made using the SQLPrimaryKeys or SQLStatistics functions in order to obtain the necessary unique identifiers for the update.

Another possible workaround for most ODBC drivers is to use a ForwardOnly cursor. This force the OLEDB provider for the ODBC data sources to use query based updates. Therefore, all updates to the driver are in the form of SQL updates.

Try adUseServer for CursorLocation 'Server side cursor' and ForwardOnly for CursorType before using the searched update workaround, since many third party ODBC drivers work correctly by specifying ForwardOnly for the CursorType.

STATUS

This behavior is by design.

REFERENCES

ODBC 3.0 Programmer's Reference; Volume 1, pg. 219.

Keywords: kbprb kb3rdparty KB192652