ADO Name Property

Home | About me | EXCEL VB Programming (XL97-2003) | ACCESS Programming | EXCEL VB.Net Programming | EXCEL Spreadsheet Functions Material Management  |  Guestbook
 

ADO Name Property

The Name property sets or returns a string that contains the name of a Command, Property, Field, or Parameter object.

Object

Description of the Name Property

Command The Name property has read/write permissions on a Connection object
Property The Name property has read-only permissions on a Property object
Field The Name property has read/write permissions when used to create a Recordset, but it has read-only permissions when you open an existing Recordset
Parameter The Name property has read/write permissions on a Parameter object that is not added to the Parameters Collection, but it has read-only permissions after the object is added to the Collection

Syntax

object.Name

Example

For a Command object:

set conn = New ADODB.Connection
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "
F:\MaterialMaster\Material_Master.mdb"

set comm=New ADODB.Command
comm.
Name="xxxxx"
debug.print(comm.
Name)

conn.close


For a Field object:

set conn=New ADODB.Connection
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "
F:\MaterialMaster\Material_Master.mdb"

set rs=New ADODB.Recordset
rs.open "SELECT * FROM tblAMSEA", conn

set f=New ADODB.Field

'Display the field attributes of the Orders Table
For each f in rs.Fields
  debug.print "Attr:" & f.Attributes & vbCrLf
  debug.print "Name:" & f.
Name & vbCrLf
  debug.print "Value:" & f.Value
Next

rs.Close
conn.close
set rs=nothing
set conn=nothing


For a Property object:

set conn=New ADODB.Connection
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "
F:\MaterialMaster\Material_Master.mdb"

set rs=New ADODB.Recordset
rs.open "SELECT * FROM tblAMSEA", conn

set prop=New ADODB.Property

'Display the property attributes of the Orders Table
For each prop in rs.Properties
  debug.print("Attr:" & prop.Attributes & vbCrLf
  debug.print("Name:" & prop.
Name & vbCrLf
  debug.print("Value:" & prop.Value & vbCrLf
Next

rs.close
conn.close
set rs=nothing
set conn=nothing