Edit Method

2016-01-29 12:39 4 1 收藏

Edit Method,Edit Method

【 tulaoshi.com - ASP.NET 】


Copies the current record from an updatable Recordset object to the copy buffer for subsequent editing.
Syntax
recordset.Edit
The recordset placeholder represents an open, updatable Recordset object that contains the record you want to edit.
Remarks
Once you use the Edit method, changes made to the current record's fields are copied to the copy buffer. After you make the desired changes to the record, use the Update method to save your changes.
The current record remains current after you use Edit.
Caution If you edit a record and then perform any operation that moves to another record, but without first using Update, your changes are lost without warning. In addition, if you close recordset or end the procedure which declares the Recordset or the parent Database or Connection object, your edited record is discarded without warning.
Using Edit produces an error if:

?There is no current record.?The Connection, Database, or Recordset object was opened as read-only.?No fields in the record are updatable.?The Database or Recordset was opened for exclusive use by another user (Microsoft Jet workspace).?Another user has locked the page containing your record (Microsoft Jet workspace).
In a Microsoft Jet workspace, when the Recordset object's LockEdits property setting is True (pessimistically locked) in a multiuser environment, the record remains locked from the time Edit is used until the update is complete. If the LockEdits property setting is False (optimistically locked), the record is locked and compared with the pre-edited record just before it's updated in the database. If the record has changed since you used the Edit method, the Update operation fails with a run-time error if you use OpenRecordset without specifying dbSeeChanges. By default, Microsoft Jet-connected ODBC and installable ISAM databases always use optimistic locking.
In an ODBCDirect workspace, once you edit (and use Update to update) a record抯 primary key field, you can no longer edit fields in that record until you close the Recordset, and then retrieve the record again in a subsequent query.
Note To add, edit, or delete a record, there must be a unique index on the record in the underlying data source. If not, a "Permission denied" error will occur on the AddNew, Delete, or Edit method call in a Microsoft Jet workspace, or an "Invalid argument" error will occur on the Update call in an ODBCDirect workspace.

来源:https://www.tulaoshi.com/n/20160129/1487054.html

延伸阅读
cool edit pro怎么编辑音乐   用鼠标拖放选一段音频,把它复制到复制到新的文件中,再回到源文件复制另外一段,然后到在新文件中,粘贴到某其他位置。 cool edit pro怎么剪辑? 从哪里开始剪辑上把黄色的线点击哪里想要放的位置放准确最好是到上面的绿线 (其放大缩小的作用) 缩短可以找到的更准确,然后单击正确的关键点...
C# 新增的特性中引起争议的有许多, 分部方法 (Partial Method)算是一个。分部方法通常被定义在一个分部类中,在常规的类文件中也可实现。如果分部方法没有被实现,编译器就不会、对他们进行编译。 分部方法有着严格的限制。它们必须是私有的,不能返回值,不能有输出参数。因为任何针对没有被实现的分部方法的调用都会简单地被忽略...
Cool Edit高音激励处理怎么使用   1、在Cool Edit界面找到效果并点击DirectX,选择BBE Sonic Maximizer,打开BBE高音激励器。 2、加载预置下拉菜单中的各种效果后,点激励器右下方的预览进行反复的试听,直至调至满意的效果后,点确定对原声进行高音激励。
MFC所提供的组件已经可以完成很多功能了,但有时候我们还需要这些控件按我们自己的意图去处理。比如EDIT控件,虽然我们可以设置EDIT控件为只能接受数字属性,但如果我们还需要它可以接收数字意外的字符,比如需要控件只能接收"2004-02-20"这样的格式的日期字符呢?我们需要自己在WM_CHAR消息里面来处理输入的字符。可是,当输入字符后,Win...

经验教程

46

收藏

13

精华推荐

热门标签

ASP
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部