dbStartCommand()
To prepare a data manipulation command.
Synopsis
int dbStartCommand(dbConnection connection, string cmdStr, dbCommand
&command);
Parameters
Parameter | Meaning |
---|---|
connection | Connection reference supplied by dbOpenConnection() |
cmdStr | Data manipulation command (on behalf of SQL string) |
command | Command reference for using the following dbCommand methods (return parameter) |
Return Value
The return value is an error code. 0 denotes successful execution of the operation. With other values detailed error information can be retrieved using dbGetError().
Errors
If an invalid connection is transferred, an error is returned. Errors in the data manipulation command (also syntax error) are only reported with dbExecuteCommand().
Description
Manipulations to a data source can be made for a particular record via record sets and globally via dbCommand objects. In the latter case a command reference is ascertained via dbStartCommand(), the command is executed with dbExecuteCommand() and the command reference is released again with dbFinishCommand().
SQL data manipulation commands (DML, i.e. INSERT, DELETE and UPDATE) are usually issued via this interface. Manipulations to individual data record fields are usually easier to carry out via record sets.
Example
Assignment
ADO and Qt, Database functions
Availability
CTRL