ComponentOne True DataControl 8.0
CommandType Property

 

CommandType Property

This property indicates how the RecordSource text is to be interpreted while creating SourceRecordset in data source mode (DataMode = 0 - DataSource).

Syntax

TData.CommandType = value

Remarks

Read/Write at run time and design time. Property applies to TData control.

 

Values

8

adCmdUnknown (default)

1

adCmdText

2

adCmdTable

4

adCmdStoredProc

512

adCmdTableDirect

 

When set to 8 – adCmdUnknown, the TData control makes calls to the OLE DB provider to determine if the RecordSource text is a SQL statement, a stored procedure, or a table name. This can create performance overhead, so it is recommended that you change the CommandType property if you know the type of command you are using.

When set to 1 – adCmdText, the TData control interprets the RecordSource text as a command text (usually, a SQL statement).

When set to 2 – adCmdTable, or to 512 – adCmdTableDirect, the TData control interprets the RecordSource text as a table name. The difference between adCmdTable and adCmdTableDirect is that adCmdTableDirect can be slightly more optimal since ADO does not try to use a command opening the recordset (see ADO documentation for details).

When set to 4 – adCmdStoredProc, the TData control interprets the RecordSource text as a stored procedure name.

CommandType is a standard ADO property. It can be set at any time during the control’s lifetime, but it will take effect only if set at design time, in WillOpenData event or after the Refresh method is called.

See Also

TData Control

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback