Public Member Functions | |
PROUDSRV_API | CAdoCommand (ADODB::_Command *conn) |
PROUDSRV_API void | Prepare (ADODB::_Connection *connection, const String &storedProcName, ADODB::CommandTypeEnum cmdType=ADODB::adCmdStoredProc) |
PROUDSRV_API void | Execute (OUT long *recordsAffected=NULL) |
PROUDSRV_API void | Execute (OUT CAdoRecordset &outRecordset, OUT long *recordsAffected=NULL) |
PROUDSRV_API CVariant | GetParam (int index) |
PROUDSRV_API void | SetParam (int index, const CVariant &value) |
PROUDSRV_API ADODB::_ParameterPtr | AppendParameter (const String ¶mName, ADODB::DataTypeEnum paramType, ADODB::ParameterDirectionEnum paramDirection, const CVariant &defaultValue) |
PROUDSRV_API ADODB::_ParameterPtr | AppendParameter (const String ¶mName, ADODB::DataTypeEnum paramType, ADODB::ParameterDirectionEnum paramDirection, const String &defaultValue) |
PROUDSRV_API ADODB::_ParameterPtr | AppendParameter (ADODB::DataTypeEnum paramType, ADODB::ParameterDirectionEnum paramDirection, const String &defaultValue) |
PROUDSRV_API ADODB::_ParameterPtr | AppendParameter (const String ¶mName, ADODB::DataTypeEnum paramType, ADODB::ParameterDirectionEnum paramDirection) |
PROUDSRV_API ADODB::_ParameterPtr | AppendParameter (const String ¶mName, ADODB::DataTypeEnum paramType, ADODB::ParameterDirectionEnum paramDirection, const String &defaultValue, long length) |
PROUDSRV_API ADODB::_ParameterPtr | AppendInputParameter (const String ¶mName, const Guid &value) |
PROUDSRV_API ADODB::_ParameterPtr | AppendReturnValue () |
Additional Inherited Members | |
PROUDSRV_API void | ExecuteBegin () |
PROUDSRV_API void | ExecuteEnd (const String &command) |
This is a class wrapping ADO Command object.
How to call stored procedure with this method is shown in below.
PROUDSRV_API ADODB::_ParameterPtr Proud::CAdoCommand::AppendInputParameter | ( | const String & | paramName, |
const Guid & | value | ||
) |
Convenient function for AppendParameter.
PROUDSRV_API ADODB::_ParameterPtr Proud::CAdoCommand::AppendParameter | ( | const String & | paramName, |
ADODB::DataTypeEnum | paramType, | ||
ADODB::ParameterDirectionEnum | paramDirection, | ||
const CVariant & | defaultValue | ||
) |
Add parameter value. This is not commonly used in MsSQL, but this method must be used in MySQL instead of SetParam.
paramName | Name of parameter procedure to call for |
paramType | Refer to Data Type ADODB::DataTypeEnum |
paramDirection | Refer to Data insertion direction ADODB::ParameterDirectionEnum.(MySQL must use adParamInput only. Output is not supported.) |
defaultValue | Value that will be passed to the actual procedure |
PROUDSRV_API ADODB::_ParameterPtr Proud::CAdoCommand::AppendParameter | ( | const String & | paramName, |
ADODB::DataTypeEnum | paramType, | ||
ADODB::ParameterDirectionEnum | paramDirection, | ||
const String & | defaultValue | ||
) |
Refer to the same method
defaultValue | String value of the actual procedure |
PROUDSRV_API ADODB::_ParameterPtr Proud::CAdoCommand::AppendParameter | ( | const String & | paramName, |
ADODB::DataTypeEnum | paramType, | ||
ADODB::ParameterDirectionEnum | paramDirection | ||
) |
Refer to the same method but internally _variant_t will be added
PROUDSRV_API ADODB::_ParameterPtr Proud::CAdoCommand::AppendParameter | ( | const String & | paramName, |
ADODB::DataTypeEnum | paramType, | ||
ADODB::ParameterDirectionEnum | paramDirection, | ||
const String & | defaultValue, | ||
long | length | ||
) |
Refer to the same method
defaultValue | String value of the actual procedure |
length | The maximum length of string |
PROUDSRV_API void Proud::CAdoCommand::Execute | ( | OUT long * | recordsAffected = NULL | ) |
Execute the appointed stored procedure at PrepareSP.
recordsAffected | Number of records affected by stored procedure |
PROUDSRV_API void Proud::CAdoCommand::Execute | ( | OUT CAdoRecordset & | outRecordset, |
OUT long * | recordsAffected = NULL |
||
) |
Execute the appointed stored procedure at PrepareSP.
outRecordset | Recordset of results to get. |
recordsAffected | Number of records affected by stored procedure |
PROUDSRV_API CVariant Proud::CAdoCommand::GetParam | ( | int | index | ) |
Get parameter value of nth pointed by index. This can be used after PrepareSP is called.
Which | nth of parameter value do you want to get? 0 is return value of stored procedure and the res of parameters are 1-based index. |
PROUDSRV_API void Proud::CAdoCommand::Prepare | ( | ADODB::_Connection * | connection, |
const String & | storedProcName, | ||
ADODB::CommandTypeEnum | cmdType = ADODB::adCmdStoredProc |
||
) |
This method sets ready to call stored procedure. Meaning, it prepares ADO Connection, stored procedure name and inout argument.
connection | |
storedProcName |
PROUDSRV_API void Proud::CAdoCommand::SetParam | ( | int | index, |
const CVariant & | value | ||
) |
This method sets value of nth parameter pointed by index. It can be used after PrepareSP is called.
index | Which nth parameter value do you want to set? 0 is return value of stored procedure and the res of parameters are 1-based index. |
value | Setting paramter value |
NOTE This function is very slow because of executing an additional stored procedure for getting procedure information. It is not recommended to use this function. The workaround is to use AppendParameter() instead.