Click to See Complete Forum and Search --> : ADO Query generation


v_krishnan
September 24th, 2001, 01:39 AM
Hi,

Can anyone tell me whether it is possible to specify that the queries generated by MS ADO Data Control be based on the primary key. Also, is their some way to manually specify a primary key in a recordset and then ask the control to use that key in generating the queries?

dcaillouet
September 24th, 2001, 07:13 AM
I'm not sure if this answers your question, but maybe it will help you find your answer:

You can specify that a recordset base its update criteria on a primary key by using the following syntax. Look up "adCriteriaKey in the help file for more details:
rs.Properties("Update Criteria") = adCriteriaKey

You can't manually specify the primary key in a recordset if its coming from a server. If you need to find out what the primary key of a table is dynamically, you can call the sp_pkeys stored procedure.