Updating a row in a recordset

What properties to you set to make a SQL 2005 recordset updatable?

In Access, it's
Recordset.edit
Recordset!FieldName=SomeValue
Recordset.update

Any help is appreciated.
Charlie [ Fr, 07 September 2007 23:04 ] [ ID #1814727 ]

Re: Updating a row in a recordset

Charlie (jadkins4 [at] yahoo.com) writes:
> What properties to you set to make a SQL 2005 recordset updatable?
>
> In Access, it's
> Recordset.edit
> Recordset!FieldName=SomeValue
> Recordset.update
>
> Any help is appreciated.

There are no properties you can set. Either the column is updatable or
it is not.

Un-updatable columns are for instance computed columns, or columns from
UNION queries.

You can always address the problem by bouncing the data over a temp table.




--
Erland Sommarskog, SQL Server MVP, esquel [at] sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downlo ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books .mspx
Erland Sommarskog [ Fr, 07 September 2007 23:18 ] [ ID #1814729 ]

Re: Updating a row in a recordset

To add on to Erland's response, APIs that use client cursors often require
that each row have a unique column(s) (e.g. primary key) in order to be
updatable. This is because an UPDATE statement is generated under the
covers and the generated WHERE clause needs to specify values that uniquely
identify the row to be updated. Make sure all tables have a primary key.


--
Hope this helps.

Dan Guzman
SQL Server MVP

"Charlie" <jadkins4 [at] yahoo.com> wrote in message
news:46e1bcd7$0$32553$4c368faf [at] roadrunner.com...
> What properties to you set to make a SQL 2005 recordset updatable?
>
> In Access, it's
> Recordset.edit
> Recordset!FieldName=SomeValue
> Recordset.update
>
> Any help is appreciated.
>
Dan Guzman [ Sa, 08 September 2007 15:53 ] [ ID #1815572 ]
Datenbanken » comp.databases.ms-sqlserver » Updating a row in a recordset

Vorheriges Thema: Add records in a table
Nächstes Thema: Live updates?