Executing SQL Queries with Runtime Error Check

If the command is used to execute the SQL query with multiple sets of parameter values, all the sets in the range from zero to IDalCommand.CurrentParamsRow are processed on calling the IDalCommand.Execute or IDalCommand.ExecuteWithoutLast methods. After executing the command, the IDalCommand.CurrentParamsRow pointer is reset to zero. This enables the user to go through all the sets again, set new values and execute the command again. If an error occurs at the SQL query execution, the IDalCommand.CurrentParamsRow pointer is still reset to zero. That is why the user cannot identify which set caused the query execution error. To execute the command without resetting the pointer of processed sets of values, the IDalCommandEx interface was developed. To execute the command in this interface, use the ExecuteEx and ExecuteWithoutLastEx methods. When the input parameter is set to False in these methods, the IDalCommand.CurrentParamsRow pointer of parameter value sets is not reset after execution. Use the IDalCommandEx.SetCurrentParamsRow method to navigate the sets of parameter values, to create a separate command and check execution with the selected set of values.

The example of such checking is given in description of the IDalCommandEx.ExecuteEx method.

See also:

Introduction