O'Reilly logo

Access™ 2007 VBA Programmer's Reference by Armen Stein, Geoffrey Griffith, Rob Cooper, Teresa Hennig

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required