delphi最基础的SQL查询 - Delphi / 数据库相关
我要查询X表中 收入 = Y的 字段
比如 我在SQL中 是这么输入的 slect * from X where 收入 = y
在delphi 中 y 就用edit1.text里输入
begin
adoquery1.Close;
ADOQuery1.SQL.Clear;
adoquery1.SQL.Add('select * from xmb where 收入='+''''+trim(edit1.Text)+'''');
try
adoquery1.open;
except
showmessage('没有该收入记录');
exit;
end;
这段断码的话,如果收入文本的可以执行 ,但如果收入是数值的 应该怎么修改代码!
请各位大虾指教!
注意:收入字段是数字型
好结帐了
建议这么写:
adoquery1.SQL.Add('select * from xmb where 收入:= earn')
adoquery1.Parameters.ParamValues['earn'] := trim(edit1.Text);
同意3楼的
delphi当时课设都没怎么做,哎。。。
来结账了
相关问答:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
现在有两张表:文章主表A(articleId,articleTitle),文章评论表B(commentId,articleId,commentTitle)
现在我想实现这样的功能:列出文章列表,其中每篇文章标题下面列出此文章的前2个文章评论,请问sql语句怎么写啊 ......
如何在SQL2005中设定定时作业,比如说定时清理某些表的数据,
或者是定时的将某些表的数据导出excel!
在线等待,急急急,最好是详细步骤!
之前我做的作业有点问题!
帮UP
参考:http://hi.baidu.com/toiota ......
具体要求与报酬QQ729851670
771234717
“拼音编程”是什么意思
引用
“拼音编程”是什么意思
1.给一个字可以显示拼音,多音字的话能显示对应的多个拼音
2.对包含多音字的词语智能识别给出拼音。
3.对一段 ......
请教高手:
以下是数据库中的三条记录,英文为字段名称
id planname TaskBeginTime Status
329 2010年03 ......