Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO recordset, update with use of primary key

Status
Not open for further replies.

Jaco

Programmer
Aug 29, 2000
57
PL
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:
Code:
rs.Properties("Update Criteria") = adCriteriaKey
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:
Code:
select field1, field2.. from table where ...
and a second one
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top