查询问题?(10分)

  • 主题发起人 主题发起人 gaoliang80
  • 开始时间 开始时间
G

gaoliang80

Unregistered / Unconfirmed
GUEST, unregistred user!
with qd do
begin
close;
sql.clear;
sql.add('select * from "qd"');
sql.add('where substr(gh,1,1)=:gh');
params[0].value:=gh.text;
open;
end;
运行时候报错:capablitily not support,是不是delphi中不支持,但要达到此效果,应怎么办?
with qd do
begin
close;
sql.clear;
sql.add('select * from "qd"');
sql.add('where substr(gh,1,1)=:gh');
params[0].value:=gh.text;
open;
end;
运行时候报错:capablitily not support,是不是delphi中不支持,但要达到此效果,应怎么办?
with qd do
begin
close;
sql.clear;
sql.add('select * from "qd"');
sql.add('where substr(gh,1,1)=:gh');
params[0].value:=gh.text;
open;
end;
运行时候报错:capablitily not support,是不是delphi中不支持,但要达到此效果,应怎么办?
 
sql.clear;
sql.add('select * from qd');
sql.add(' where gh like ''%'+gh.text+'''');
open;
 
procedure TForm.Button1Click(Sender:TObject);
var
ssql:string;
begin
with qd do
begin
ssql:='select * from qd where gh like' + #39 + gh.text + #39;
sql.Clear;
sql.add (ssql);
open;
end;
end;
 
procedure TForm.Button1Click(Sender:TObject);
var
ssql:string;
begin
ssql:='select * from qd where gh like' + #39 +'%' + gh.text +'%'+ #39;
with qd do
begin
sql.Clear;
sql.add (ssql);
open;
end;
end;
 
sql.add('select * from qd where gh like ''' + '%'+gh.text+'%''');
 
params[0].value:=gh.text;
改成
params[0].asstring:=gh.text;
 

Similar threads

A
回复
0
查看
945
Andreas Hausladen
A
A
回复
0
查看
823
Andreas Hausladen
A
I
回复
0
查看
664
import
I
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部