ADO Name ความหมาย

การเรียกใช้และการกำหนด

Name ความหมายสามารถตั้งค่าหรือคืนค่าตัวแปลสตริงที่มีค่า Command, Property, Field หรือ Parameter ความหมาย

ตัว คำอธิบายของ Name ความหมาย
Command Name ความหมายมีสิทธิ์เขียน/อ่านสำหรับองค์ประกอบ Command
Property Name ความหมายมีสิทธิ์อ่านเพียงตัวเดียวสำหรับ Property ความหมาย
Field Name ความหมายมีสิทธิ์เขียน/อ่านเมื่อถูกใช้ในการสร้าง Recordset แต่เมื่อเปิด Recordset ที่มีอยู่แล้วเป็นการอ่านเพียงตัวเดียว
Parameter สำหรับองค์ประกอบ Parameter ที่ยังไม่ได้เพิ่มเข้าชุด Parameters ของมัน Name ความหมายเป็นการเขียน/อ่าน สำหรับองค์ประกอบที่เพิ่มเข้าชุดและองค์ประกอบอื่น ๆ Name ความหมายเป็นการอ่านเพียงตัวเดียว ชื่อในชุดไม่จำเป็นต้องเป็นเดียวกัน

ภาษาบอร์เดอร์

object.Name

ตัวอย่าง

ต่อเนื่องถึงองค์ประกอบ Command:

<%
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")
'แสดงคุณสมบัติของฟิลด์ในตาราง Orders
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
%>

ต่อเนื่องถึงองค์ประกอบ Property:

<%
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 & "
") response.write("Name:" & prop.Name & "
") response.write("Value:" & prop.Value & "
") next
rs.close conn.close set rs=nothing set conn=nothing %>