<完整参数对象参考
Name属性设置或返回一个包含命令,属性,字段或参数对象的名称的字符串。
目的 | Name属性的说明 |
---|---|
命令 | name属性Connection对象的读/写权限 |
属性 | Name属性有只读权限的属性对象 |
领域 | 用于创建一个记录集时,Name属性具有读/写权限,但它具有只读权限,当您打开一个现有记录 |
参数 | Name属性已读未添加到参数集合Parameter对象上/写权限,但它具有只读权限的对象被添加到集合后 |
句法
object.Name
例如 - 对于命令对象
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
set comm=Server.CreateObject("ADODB.Command")
comm.Name="xx"
response.write(comm.Name)
conn.close
%>
例如 - 对于Field对象
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open "Select * from orders", conn
set f=Server.CreateObject("ADODB.Field")
'Display the field attributes of the Orders Table
for each f in rs.Fields
response.write("Attr:" & f.Attributes & "<br>")
response.write("Name:" & f.Name & "<br>")
response.write("Value:" & f.Value & "<br>")
next
rs.Close
conn.close
set rs=nothing
set conn=nothing
%>
示例 - 一个属性对象
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open "Select * from orders", conn
set prop=Server.CreateObject("ADODB.Property")
'Display the property attributes of the Orders Table
for each prop in rs.Properties
response.write("Attr:" & prop.Attributes & "<br>")
response.write("Name:" & prop.Name & "<br>")
response.write("Value:" & prop.Value & "<br>")
next
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
<完整参数对象参考