ADO Properties Collection

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

ADO Properties Collection

The Properties Collection is a collection of Property objects. Each Property object contains a single piece of information, called a dynamic property, about the database provider. By referring to the Properties Collection, each connection to a provider can be tailored specifically by ADO to suit the exact needs of that provider.

This ability to be flexible when handling the various idiosyncrasies of individual database providers greatly enhances the usefulness of ADO.
 
The Command, Connection, Field, Parameter, Record and Recordset objects have access to the Properties Collection.
 
The Properties Collection has two properties and one method.


Properties
Count

The Count property returns a long value that is the number of items in the collection. The counting starts at zero. You can use this value to loop through the collection by iterating from zero to the value of Count minus one.

Example:

intCountNumber = objCommand.Properties.Count

Item
|The Item property is used to return a specific member of the Properties Collection. The Index parameter is a variant. It can be the named item or the position (ordinal) number.

Example:

MyProperty = objCommand.Properties.Item(5)

'Or

MyProperty = objCommand.Properties(5)

'Or

MyProperty = objCommand.Properties("Transaction DDL")

Methods
Refresh

The Refresh method updates the Property objects in the Properties Collection with the dynamic property information specific to the provider. It is quite possible that the provider has dynamic properties that are not supported by ADO.

Example:

objCommand.Properties.Refresh