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 ......
字段1,字段2.....字段N,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
想要的结果是:
1,Na ......
具体要求与报酬QQ729851670
771234717
“拼音编程”是什么意思
引用
“拼音编程”是什么意思
1.给一个字可以显示拼音,多音字的话能显示对应的多个拼音
2.对包含多音字的词语智能识别给出拼音。
3.对一段 ......
求个vb中的sql语句的写法,次sql语句的用法是分页程序
我写的如下:其中A是用来接收每页显示的记录的条数,B是用来接收显示的当前的页面.
sqltext="select top A * from log where id not in(select top ( ......
我觉得mysql和sqlserver有共同的地方:
有个问题是关于表的锁问题:
进程A 进程B
select * from user where id in lock share mode(共享锁)
&nb ......