D.4. The Command Object

The Command object allows you to do several things. You can query a database and return records in a recordset, execute a bulk operation, or manipulate the database structure. The flexibility of the Command object depends on the provider used. Depending on the provider, some properties or methods might generate errors when referenced.

D.4.1. Properties of the Command Object

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

PropertyData TypeDescription
ActiveConnectionString or ConnectionIndicates which Connection object the Command object uses
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
CommandStreamStream objectStream used as the input for the Command object
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
PreparedBooleanTrue if the provider should save a compiled version of a Command before execution
StateLongValue that represents if the Command object is open, closed, or in the process of connecting, executing, or retrieving information
NamedParametersBooleanIndicates whether parameter names are passed to the provider

You don't ...

Get Access 2003 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.