zoukankan      html  css  js  c++  java
  • (转载)ADOQuery参数传递

    ADOQuery参数传递

    dbgrid1.DataSource := datasource1;
    datasource1.DataSet := adoquery1;
    Value := 1221;
    SQL := 'SELECT * FROM customer WHERE CustNo>:Number';
    adoquery1.SQL.Clear;
    adoquery1.Parameters.Clear;
    adoquery1.sql.Add(SQL);
    // adoquery1.ParamCheck := true;
    adoquery1.Parameters.ParamByName('Number').Value := strtointdef(edit1.Text, 1);

    adoquery1.close;
    adoquery1.SQL.Clear;
    adoquery1.SQL.Add('select * from new where 1=1');
    adoquery1.SQL.Add('and 购货单位=:company');
    adoquery1.SQL.Add('and 品名=:name');
    adoquery1.Parameters[0].Value:=edit1.Text;
    adoquery1.Parameters[1].value:=edit2.Text;
    adoquery1.Open;
    应该成

    adoquery1.close;
    adoquery1.SQL.Clear;
    adoquery1.SQL.Add('select * from new where 1=1');
    adoquery1.SQL.Add('and 购货单位=:company');
    adoquery1.SQL.Add('and 品名=:name');
    adoquery1.Parameters.ParamValues['company']:=edit1.Text;
    adoquery1.Parameters.ParamValues['name']:=edit2.Text;
    adoquery1.Open;


    adoquery1.close;
    adoquery1.SQL.Clear;
    adoquery1.SQL.Add('select * from new where 1=1');
    adoquery1.SQL.Add('and 购货单位=:company');
    adoquery1.SQL.Add('and 品名=:name');
    adoquery1.Parameters.ParamByName(''company').value:=edit1.text;
    adoquery1.Parameters.ParamByName('name').value:=edit2.text;
    adoquery1.Open;

    http://www.delphibbs.com/keylife/iblog_show.asp?xid=22167

  • 相关阅读:
    InPut 标签 HTML(表单)
    JavaScript Table 对象
    JCBD
    JCBD
    JavaScript prototype 属性
    Java8 新特性
    JavaScript 对象的使用
    Java 反射
    虚拟机VirtualBox启动虚拟机报Only Ethernet Adapter' (VERR_INTNET_FLT_IF_NOT_FOUND).
    Impala 数值函数
  • 原文地址:https://www.cnblogs.com/angelbd/p/3373141.html
Copyright © 2011-2022 走看看