Re: How to create a temporary Primary Index for an ADO recordset



DPM wrote:
Hi,



My requirement is to base the updates issued from an ADO RecordSet,
on SQL server to use the Primary Key, rather than using all the
fields in the WHERE clause, for the UPDATE.



This can be done by setting the property in the RecordSet as follows,

RecordSet.Properties("Update Criteria").Value = 0



But is there any way without creating a Primary Key in the SQL DB to
issue the update for a given field ?


Not that I know of.

Or could this be achieved by creating a temporary Primary Key on the
RecordSet ?

No.


The only way to have total control over this is to write and execute your
own UPDATE statement.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.



Relevant Pages

  • Re: Help needed with ADO Update
    ... Any ideas of why this isn't considered an "updateable query"? ... No primary key on the tablereferenced. ... If he was using a recordset ... This email account is my spam trap so I ...
    (microsoft.public.data.ado)
  • Re: Adding records to SQL table
    ... > I'd just get 'SQL Server doesn't exist or access denied' about every 5 ... >>> and opens a recordset, ... would it be quicker if there IS a primary key on the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Adding records to SQL table
    ... > I'd just get 'SQL Server doesn't exist or access denied' about every 5 ... >>> and opens a recordset, ... would it be quicker if there IS a primary key on the ...
    (microsoft.public.vb.general.discussion)
  • Re: Adding records to SQL table
    ... > I'd just get 'SQL Server doesn't exist or access denied' about every 5 ... >>> and opens a recordset, ... would it be quicker if there IS a primary key on the ...
    (microsoft.public.sqlserver.programming)
  • Re: E_FAIL status when adding record to ADO Recordset
    ... the table in SQL Server has a primary key (and the Access linked ... >> The recordset object is set at a module level, and it is opened in the ... >> Private Sub Form_Activate ...
    (microsoft.public.vb.database.ado)