AddNew Method Example

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

AddNew Method Example,AddNew Method Example

【 tulaoshi.com - ASP.NET 】


'This example uses the AddNew method to create a new record with the specified 'name. The AddName function is required for this procedure to run.
Sub AddNewX()
Dim dbsNorthwind As Database Dim rstEmployees As Recordset Dim strFirstName As String Dim strLastName As String
Set dbsNorthwind = OpenDatabase("Northwind.mdb") Set rstEmployees = _ dbsNorthwind.OpenRecordset("Employees", dbOpenDynaset)
' Get data from the user. strFirstName = Trim(InputBox( _ "Enter first name:")) strLastName = Trim(InputBox( _ "Enter last name:"))
' Proceed only if the user actually entered something
' for both the first and last names. If strFirstName <> "" and strLastName <> "" Then
' Call the function that adds the record. AddName rstEmployees, strFirstName, strLastName
' Show the newly added data. With rstEmployees Debug.Print "New record: " & !FirstName & _ " " & !LastName ' Delete new record because this is a demonstration. .Delete End With

Else Debug.Print _ "You must input a string for first and last name!"
End If
rstEmployees.Close dbsNorthwind.Close
End Sub
Function AddName(rstTemp As Recordset, _ strFirst As String, strLast As String)
' Adds a new record to a Recordset using the data passed ' by the calling procedure. The new record is then made ' the current record. With rstTemp .AddNew !FirstName = strFirst !LastName = strLast .Update .Bookmark = .LastModified End With
End Function

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

延伸阅读
C# 新增的特性中引起争议的有许多, 分部方法 (Partial Method)算是一个。分部方法通常被定义在一个分部类中,在常规的类文件中也可实现。如果分部方法没有被实现,编译器就不会、对他们进行编译。 分部方法有着严格的限制。它们必须是私有的,不能返回值,不能有输出参数。因为任何针对没有被实现的分部方法的调用都会简单地被忽略...
标签: Web开发
open Method Assigns method, destination URL, and other optional attributes of a pending request. Syntax XMLHttpRequest .open( sMethod , sUrl [ , bAsync ] [ , sUser ] [ , sPassword ] ) [/pre] Parameters sMethod Required. String that specifies the HTTP method used to open the connection: suc...
标签: 暗黑破坏神3
《暗黑破坏神3》欧服Method公会已打败炼狱的骷髅王 欧服Method公会已打败炼狱的骷髅王。在这短短时间里就取得如此惊人的成绩,不得不让玩家感叹之前暴雪一再声明的很难在哪里?   更新: 我们收集到了他们打败炼狱难度骷髅王的全程视频: 《暗黑3》客户端新增测试选项 竞技场或将来临 国外媒体 Incgamers 放出了一篇新的观察评论文...

经验教程

109

收藏

89

精华推荐

热门标签

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