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

  • 相关阅读:
    1121 Django基本
    1121 爬虫简单面条版
    1118 DOM
    1114 CSS基础
    1116 前端的练习--博客界面
    1112 前端基础之标签
    仿优酷错误
    1107 python自定义实现ORM
    cesm1_2_2在南信大大型机上的移植以及运行简单case的步骤
    ERROR:105: Unable to locate a modulefile for 'xxx'
  • 原文地址:https://www.cnblogs.com/railgunman/p/9549101.html
Copyright © 2011-2022 走看看