zoukankan      html  css  js  c++  java
  • Delphi 使用TAdoQuery执行存储过程的样例

    procedure TCustomerForm.FindCustomerInfo;
    var
      strSql:string;
    begin

     //  BL_HV_FindCustomerInfo 存储过程的名称,后面是需要的全部的参数
      strSql:='exec BL_HV_FindCustomerInfo :StyleInt,:CustomerName,:RelationName,'
             +':RelationPhone,:Address,:CustomerStatus,:ErrorCode output,:ErrorMessage output';


      with adoQryCustomer do
      begin
        Close;
        SQL.Clear;
        SQL.Add(strSql);
        if rbOr.Checked = True then
          Parameters.ParamByName('StyleInt').Value := '0'
        else
          Parameters.ParamByName('StyleInt').Value := '1';
        Parameters.ParamByName('CustomerName').Value := Trim(edtFindCustomerName.Text);
        Parameters.ParamByName('RelationName').Value := Trim(edtFindRelationName.Text);
        Parameters.ParamByName('RelationPhone').Value := Trim(edtFindRelationPhone.Text);
        Parameters.ParamByName('Address').Value := Trim(edtFindAddress.Text);
        if cbFindCustomerStatus.Checked then
        Parameters.ParamByName('CustomerStatus').Value :=1
        else
        Parameters.ParamByName('CustomerStatus').Value :=0;
        ExecSQL;
        ErrorCodeStr := Parameters.ParamByName('ErrorCode').Value;

        if ErrorCodeStr <> '0' then
          ShowMessage(Parameters.ParamByName('ErrorMessage').Value)
        else
          Active := True;
      end;
      if dbgrdhCustomer.CanFocus then
        dbgrdhCustomer.SetFocus;
    end;

    转自:https://blog.csdn.net/xiongmao000738/article/details/6956094

  • 相关阅读:
    vant 移动helloworld
    ts
    study vant
    uniapp 上传图片
    electron
    1
    测试vue模板
    [Java] Spring_1700_Spring_DataSource
    [Java] Spring_1600_AOP_XML
    [Java] Spring_1500_AOP_Annotation
  • 原文地址:https://www.cnblogs.com/railgunman/p/9549101.html
Copyright © 2011-2022 走看看