Edit Method Example

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

Edit Method Example,Edit Method Example

【 tulaoshi.com - ASP.NET 】


'This example uses the Edit method to replace the current data with the 'specified name. The EditName procedure is required for this procedure to run.
Sub EditX()
Dim dbsNorthwind As Database Dim rstEmployees As Recordset Dim strOldFirst As String Dim strOldLast As String Dim strFirstName As String Dim strLastName As String
Set dbsNorthwind = OpenDatabase("Northwind.mdb") Set rstEmployees = _ dbsNorthwind.OpenRecordset("Employees", _ dbOpenDynaset)
' Store original data. strOldFirst = rstEmployees!FirstName strOldLast = rstEmployees!LastName
' Get new data for record.
strFirstName = Trim(InputBox( _ "Enter first name:")) strLastName = Trim(InputBox( _ "Enter last name:"))
' Proceed if the user entered something for both fields. If strFirstName <> "" and strLastName <> "" Then ' Update record with new data. EditName rstEmployees, strFirstName, strLastName

With rstEmployees ' Show old and new data. Debug.Print "Old data: " & strOldFirst & _ " " & strOldLast Debug.Print "New data: " & !FirstName & _
" " & !LastName ' Restore original data because this is a ' demonstration. .Edit !FirstName = strOldFirst !LastName = strOldLast .Update End With
Else Debug.Print _ "You must input a string for first and last name!" End If
rstEmployees.Close dbsNorthwind.Close
End Sub
Sub EditName(rstTemp As Recordset, _ strFirst As String, strLast As String)
' Make changes to record and set the bookmark to keep
' the same record current. With rstTemp .Edit !FirstName = strFirst !LastName = strLast .Update .Bookmark = .LastModified End With
End Sub

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

延伸阅读
为了让实例变量的值能够在需要的时候改变,我们应该提供一个方法来改变其值; 这种方法被特别地称为 存取方法(access method)。依照惯例,只是简单的用来改变实例变量值的方法名称应该以 "set" 开头:       void setBark(String barkSound) {         this.barkSound = bark...
标签: Web开发
flush(); $ftp_ini_datei         = $argv[1]; require ('./ftp_class.php'); require ($ftp_ini_datei); echo "\nCronjob started : "; echo date("d.m.Y  - H:i:s"); echo "\n"; $newftp         = new myftp; if(!$anonymous)...
Cool Edit如何降噪音   1、点击左下方的波形水平放大按钮(带+号的两个分别为水平放大和垂直放大)放大波形,以找出一段适合用来作噪声采样波形。 2、点鼠标左键拖动,直至高亮区完全覆盖你所选的那一段波段。右单击高亮区选复制为新的,将此段波形抽离出来。 3、打开效果--噪声消除--降噪器准备进行噪声采样。并保存采...
cool edit pro怎么编辑音乐   用鼠标拖放选一段音频,把它复制到复制到新的文件中,再回到源文件复制另外一段,然后到在新文件中,粘贴到某其他位置。 cool edit pro怎么剪辑? 从哪里开始剪辑上把黄色的线点击哪里想要放的位置放准确最好是到上面的绿线 (其放大缩小的作用) 缩短可以找到的更准确,然后单击正确的关键点...

经验教程

819

收藏

5

精华推荐

C#分部方法(Partial Method)讨论

C#分部方法(Partial Method)讨论

野狼小神君

Cool Edit高音激励处理怎么使用

Cool Edit高音激励处理怎么使用

逝月留影

VC增强Edit控件为日期输入控件

VC增强Edit控件为日期输入控件

国家队财政管理

热门标签

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