怎样用C++ builder 6 用ADOStoredProc调用SQL SERVER 2000 中带有输入输出参数的存储过程??并且全部要用代码实现,不在设计状态下设属性

lihongxing2002 2003-05-29 10:02:29
怎样用C++ builder 6 用ADOStoredProc调用SQL SERVER 2000 中带有输入输出参数的存储过程??能够接受传出值,能够把需要的值传给存储过程, 并且全部要用代码实现,不在设计状态下设属性值。 急!!!
...全文
28 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
qsfsea 2003-09-06
  • 打赏
  • 举报
回复
gz
annkie 2003-05-29
  • 打赏
  • 举报
回复
JxcDM->adosp_cancelorder->ProcedureName="Proc_UpdateIndentDetail";
JxcDM->adosp_cancelorder->Parameters->Refresh();
JxcDM->adosp_cancelorder->Parameters->ParamByName("@v_tablename")->Direction = pdInput;
JxcDM->adosp_cancelorder->Parameters->ParamByName("@v_tablename")->DataType = ftString;
JxcDM->adosp_cancelorder->Parameters->ParamByName("@v_tablename")->Value=tablename;

JxcDM->adosp_cancelorder->Parameters->ParamByName("@v_output")->Direction = pdOutput;
JxcDM->adosp_cancelorder->Parameters->ParamByName("@v_output")->DataType = ftString;

JxcDM->adosp_cancelorder->Parameters->ParamByName("@RETURN_VALUE")->Direction = pdReturnValue;
JxcDM->adosp_cancelorder->Parameters->ParamByName("@RETURN_VALUE")->DataType = ftInteger;
JxcDM->adosp_cancelorder->Prepared=true;
JxcDM->adosp_cancelorder->ExecProc();

ShowMessage(JxcDM->adosp_cancelorder->Parameters->ParamByName("@v_output")->Value);

if(JxcDM->adosp_cancelorder->Parameters->ParamByName("@RETURN_VALUE")->Value!=0)
Application->MessageBox("Failed!","",MB_OK|MB_ICONINFORMATION);
else
Application->MessageBox("Succeed!","",MB_OK|MB_ICONINFORMATION);

1,178

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder 数据库及相关技术
社区管理员
  • 数据库及相关技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧