This is a detailed description for the used ADOCommand command in the articles Stored Procedures and Navision and ADO in Navision.
The ADO Command is defined by the automation ‘Microsoft ActiveX Data Objects 2.8 Library’.Command
It is used to execute a query against a database.
In the mentioned articles we are using the following ADOCommand methods:
Sets the definition for the current connection.
The provider command. Is often either a sql query script or a stored procedure.
Sql query script example: ADOCommand.CommandText := ‘SELECT count(*) FROM [Customers]’;
Stored Procedure example: ADOCommand.CommandText := ‘[SP_CountCustomers]’;
The type of command, that is being executed with the CommandText.
Valid values are:
|-1||adCmdUnspecified||Command type argument not specified|
|1||adCmdText||CommandText is a sql query script|
|2||adCmdTable||CommandText is a table name whose columns are all returned by an internally generated SQL query|
|4||adCmdStoredProc||CommandText is a stored procedure name|
|8||adCmdUnknown||Type of command in the CommandText property is unknown.|
|256||adCmdFile||CommandText is the file name of a persistently stored Recordset|
|512||adCmdTableDirect||CommandText is a table name whose columns are all returned|
No. of seconds to wait while trying to execute a command.
Creates a Parameter object. Is often used when calling Stored Procedures, where parameters are required.It takes the parameters name, type, direction, size and value.
- name is the name of the parameter object
- type specifies the data type for the object
- direction defines the direction of the parameter – in or out
- size specifies the length of a variable data type
- value is value of the parameter object
Example on types are:
- adBoolean (11) – indicates an boolean value
- adBSTR (8) – indicates a null-terminated character string
- adDate (7) – indicates a date value
- adDecimal (14)
- ad Numeric (131)
The complete list can be seen here.
Executes the query, sql statement or procedure stated in the CommandText
Appends the parameters created by the CreateParameter command.
Parameters contains all the parameters of a command object.
Leave a Reply