(转载)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
(转载)ADOQuery参数传递的更多相关文章
- C#调用C++编写的DLL函数, 以及各种类型的参数传递 (转载)
C#调用C++编写的DLL函数, 以及各种类型的参数传递 1. 如果函数只有传入参数,比如: C/C++ Code Copy Code To Clipboard //C++中的输出函数 int ...
- mybatis:三种参数传递(转载)
转载自:https://www.2cto.com/database/201409/338155.html 第一种方案 DAO层的函数方法 Public User selectUser(String n ...
- 转载--js对象无法当成参数传递
今天我碰到了这个问题一头雾水,明明记得对象是可以传参的啊.我使用了一款基于bootstrap的表格插件DataTables,想把行信息直接传给操作函数,方便编辑(此行信息是一个对象,按道理可以的啊), ...
- [转载]MVVM模式原理分析及实践
没有找到很好的MVVM模式介绍文章,简单找了一篇,分享一下.MVVM实现了UI\UE设计师(Expression Blend 4设计界面)和软件工程师的合理分工,在SilverLight.WPF.Wi ...
- 转载---javascript 定时器总结
转载:http://www.jb51.net/article/40193.htm JS里设定延时: 使用SetInterval和设定延时函数setTimeout 很类似.setTimeout 运用在延 ...
- 转载请注明出处: https://github.com/qiu-deqing/FE-interview
转载请注明出处: https://github.com/qiu-deqing/FE-interview Table of Contents generated with DocToc FE-inter ...
- 浅析Java中的final关键字(转载)
自http://www.cnblogs.com/dolphin0520/p/3736238.html转载 一.final关键字的基本用法 在Java中,final关键字可以用来修饰类.方法和变量(包括 ...
- 转载:《TypeScript 中文入门教程》 8、函数
版权 文章转载自:https://github.com/zhongsp 建议您直接跳转到上面的网址查看最新版本. 介绍 函数是JavaScript应用程序的基础. 它帮助你实现抽象层,模拟类,信息隐藏 ...
- S3C2440上RTC时钟驱动开发实例讲解(转载)
嵌入式Linux之我行,主要讲述和总结了本人在学习嵌入式linux中的每个步骤.一为总结经验,二希望能给想入门嵌入式Linux的朋友提供方便.如有错误之处,谢请指正. 共享资源,欢迎转载:http:/ ...
随机推荐
- perl指针引用
http://bbs.chinaunix.net/forum-viewthread-tid-570031.html
- css Hack,用IE11模拟测试的,条件注释要找真IE去测,模拟的无效
<!DOCTYPE html> <!--[if lt IE 7 ]> <html class="ie6 ie"> <![endif]--& ...
- JAVA_JSON
package cn.kjxy.JSON; import org.json.JSONArray; import org.json.JSONException; import org.json.JSON ...
- Java 开源分布式缓存框架Ehcache
http://www.codeceo.com/article/java-ehcache.html
- fstat - 读取文件相关信息
#fstat读取到的信息 ["dev"]=> int(16777220) ["ino"]=> int(66880002) ["mode&q ...
- JS精确到小数点两位
1.会四色五入 var num =2.446242342; num = num.toFixed(2); // 输出结果为 2.452.正则Number(15.7784514000.toString() ...
- [转]ODBC连接ORACLE数据库的设置
本文转自:http://www.cppblog.com/edog/articles/1420.html 首先安装Oracle,以Oracle 817为例,作为ODBC开发者的客户端,才能使用Oracl ...
- vim纯文本处理插件txtbrowser
纯文本处理插件:txtBrowser 插件作者:http://guoyoooping.blog.163.com/ Github地址:https://github.com/vim-scripts/Txt ...
- 类名.class与类名.this详解
类名.class 我们知道在java中,一个类在被加载的时候虚拟机就会自动的生成一个这个类的一个Class类型的“类对象”,每个类都对应着一个这样的类对象,通过这个Class类型的类对象,我 ...
- touch——移动端
touch事件原生一定要用addEventListener来绑定 一.原生 touchstart:触摸开始时触发 touches:当前位于屏幕上所有手指的列表 event.touches.length ...