E.4. Command Object

The Command object provides a lot of useful functionality for working with the data source. Examples of common operations include retrieving records in a recordset, executing bulk operations, and even manipulating the structure of a database. The flexibility of the Command object is specific to the provider used. Depending on the provider, some properties or methods may generate errors when referenced if the object is not supported.

E.4.1. Properties of the Command Object

The following table lists the various properties of the Command object.

PropertyDataTypeDescription
ActiveConnectionString or ConnectionIndicates which Connection object the Command object uses.
CommandStreamStream objectStream used as the input for the Command object.
CommandTextStringIndicates the text of the Command being executed.
CommandTimeoutLongSets the number of seconds a provider will wait for a command to execute.
CommandTypeCommandTypeEnumSpecifies the type of command executed. Values include: adCmdUnspecified, adCmdText, adCmdTable, adCmdStoredProc, adCmdUnknown, adCmdFile, adCmdTableDirect.
DialectGUIDContains a GUID that represents the dialect of the command text or stream.
NameStringIdentifies the Command object as a method on the associated Connection object.
NamedParametersBooleanIndicates whether parameter names are passed to the provider.
PreparedBooleanTrue if the provider should save a compiled version of a Command before execution.
StateLongValue that represents if the Command ...

Get Access™ 2007 VBA Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.