Public Member Functions | |
PROUD_API | CAdoCommand (ADODB::_Command *conn) |
PROUD_API void | Prepare (ADODB::_Connection *connection, const TCHAR *storedProcName, ADODB::CommandTypeEnum cmdType=ADODB::adCmdStoredProc) |
PROUD_API void | Execute (OUT long *recordsAffected=NULL) |
PROUD_API void | Execute (OUT CAdoRecordset &outRecordset, OUT long *recordsAffected=NULL) |
PROUD_API CVariant | GetParam (int index) |
PROUD_API void | SetParam (int index, const CVariant &value) |
__declspec (property(get=GetParam, put=SetParam)) CVariant Parameters[] | |
PROUD_API ADODB::_ParameterPtr | AppendParameter (const TCHAR *paramName, ADODB::DataTypeEnum paramType, ADODB::ParameterDirectionEnum paramDirection, const CVariant &defaultValue) |
PROUD_API ADODB::_ParameterPtr | AppendParameter (const TCHAR *paramName, ADODB::DataTypeEnum paramType, ADODB::ParameterDirectionEnum paramDirection, const TCHAR *defaultValue) |
PROUD_API ADODB::_ParameterPtr | AppendParameter (ADODB::DataTypeEnum paramType, ADODB::ParameterDirectionEnum paramDirection, const TCHAR *defaultValue) |
PROUD_API ADODB::_ParameterPtr | AppendParameter (const TCHAR *paramName, ADODB::DataTypeEnum paramType, ADODB::ParameterDirectionEnum paramDirection) |
PROUD_API ADODB::_ParameterPtr | AppendParameter (const TCHAR *paramName, ADODB::DataTypeEnum paramType, ADODB::ParameterDirectionEnum paramDirection, const TCHAR *defaultValue, long length) |
ADODB::_ParameterPtr | AppendInputParameter (const TCHAR *paramName, const Guid &value) |
ADODB::_ParameterPtr | AppendReturnValue () |
Additional Inherited Members |
This is a class wrapping ADO Command object.
How to call stored procedure with this method is shown in below.
Example
ADODB::_ParameterPtr Proud::CAdoCommand::AppendInputParameter | ( | const TCHAR * | paramName, |
const Guid & | value | ||
) |
Convenient function for AppendParameter.
PROUD_API ADODB::_ParameterPtr Proud::CAdoCommand::AppendParameter | ( | const TCHAR * | 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 |
PROUD_API ADODB::_ParameterPtr Proud::CAdoCommand::AppendParameter | ( | const TCHAR * | paramName, |
ADODB::DataTypeEnum | paramType, | ||
ADODB::ParameterDirectionEnum | paramDirection, | ||
const TCHAR * | defaultValue | ||
) |
Refer to the same method
defaultValue | String value of the actual procedure |
PROUD_API ADODB::_ParameterPtr Proud::CAdoCommand::AppendParameter | ( | const TCHAR * | paramName, |
ADODB::DataTypeEnum | paramType, | ||
ADODB::ParameterDirectionEnum | paramDirection | ||
) |
Refer to the same method but internally _variant_t will be added
PROUD_API ADODB::_ParameterPtr Proud::CAdoCommand::AppendParameter | ( | const TCHAR * | paramName, |
ADODB::DataTypeEnum | paramType, | ||
ADODB::ParameterDirectionEnum | paramDirection, | ||
const TCHAR * | defaultValue, | ||
long | length | ||
) |
Refer to the same method
defaultValue | String value of the actual procedure |
length | The maximum length of string |
PROUD_API void Proud::CAdoCommand::Execute | ( | OUT long * | recordsAffected = NULL | ) |
Execute the appointed stored procedure at PrepareSP.
recordsAffected | Number of records affected by stored procedure |
PROUD_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 |
PROUD_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. |
PROUD_API void Proud::CAdoCommand::Prepare | ( | ADODB::_Connection * | connection, |
const TCHAR * | 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 |
PROUD_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.