Hallo,
Is there a way to force ADO to use primary key while updating recordset? I use the Microsoft OLE DB Provider for ODBC and the server side cursor.
In case of the client side cursor the case is simple:
and there is no problem.
Unfortunately using client side cursors, in case of OLE DB Provider for ODBC, has a significant disadvantage. While opening a recordset there are actually two queries executed:
The one that we want the recordset to be based on,
eg:
and a second one
(!!)
I know this because I checked the database log. This is of course extremely inefficient. I guess that the second query is used to get some metadata which the ODBC data provider is not able to provide in a more efficient way.
When I use server side cursor the problem dissapers but the problem with updating, described at the begining, appears. I want the primary key to be used in the update query criteria expression but there are used all the columns from the table (!) (again I checked the query log).
Is there a way to do something about it?
Greets,
Jaco
Is there a way to force ADO to use primary key while updating recordset? I use the Microsoft OLE DB Provider for ODBC and the server side cursor.
In case of the client side cursor the case is simple:
Code:
rs.Properties("Update Criteria") = adCriteriaKey
Unfortunately using client side cursors, in case of OLE DB Provider for ODBC, has a significant disadvantage. While opening a recordset there are actually two queries executed:
The one that we want the recordset to be based on,
eg:
Code:
select field1, field2.. from table where ...
Code:
select * from table
I know this because I checked the database log. This is of course extremely inefficient. I guess that the second query is used to get some metadata which the ODBC data provider is not able to provide in a more efficient way.
When I use server side cursor the problem dissapers but the problem with updating, described at the begining, appears. I want the primary key to be used in the update query criteria expression but there are used all the columns from the table (!) (again I checked the query log).
Is there a way to do something about it?
Greets,
Jaco