dbTalk Databases Forums  

Updating a row in a recordset

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Updating a row in a recordset in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Charlie
 
Posts: n/a

Default Updating a row in a recordset - 09-07-2007 , 04:04 PM






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.



Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Updating a row in a recordset - 09-07-2007 , 04:18 PM






Charlie (jadkins4 (AT) yahoo (DOT) com) writes:
Quote:
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 (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #3  
Old   
Dan Guzman
 
Posts: n/a

Default Re: Updating a row in a recordset - 09-08-2007 , 08:53 AM



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 (DOT) com> wrote

Quote:
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.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.