procedure TForm1.Button1Click(Sender: TObject);
var
s,t:string;
begin
if checkbox1.Checked then
begin
s:=edit1.Text;
oraquery1.Close;
oraquery1.SQL.Text:='select a.personid,a.hname,b.hname,a.recordtime from y_jcyy_logpeccancy a ,j_jcyy_peccancytype b where a.peccancytypeid = b.id and a.personid='''+s+'''';
oraquery1.Open;
end;
if checkbox2.Checked then
begin
s:=edit2.Text;
oraquery1.Close;
oraquery1.SQL.Text:='select a.personid,a.hname,b.hname,a.recordtime from y_jcyy_logpeccancy a ,j_jcyy_peccancytype b where a.peccancytypeid = b.id and a.hname like'''+s+'''';
oraquery1.Open ;
end;
if checkbox1.Checked and checkbox2.Checked then
begin
s:=edit1.Text;
t:=edit2.Text;
oraquery1.Close;
oraquery1.SQL.Text:='select a.personid,a.hname,b.hname,a.recordtime from y_jcyy_logpeccancy a ,j_jcyy_peccancytype b where a.peccancytypeid = b.id and (a.hname ='''+t+''') and (a.personid='''+s+''')';
oraquery1.Open;
end;
if checkbox3.Checked then
begin
oraquery1.Close;
oraquery1.SQL.Text:='select a.personid,a.hname,b.hname,a.recordtime from y_jcyy_logpeccancy a ,j_jcyy_peccancytype b where a.peccancytypeid = b.id and (b.hname ='''+combobox1.Text+''')';
oraquery1.Open;
end;
end;
var
s,t:string;
begin
if checkbox1.Checked then
begin
s:=edit1.Text;
oraquery1.Close;
oraquery1.SQL.Text:='select a.personid,a.hname,b.hname,a.recordtime from y_jcyy_logpeccancy a ,j_jcyy_peccancytype b where a.peccancytypeid = b.id and a.personid='''+s+'''';
oraquery1.Open;
end;
if checkbox2.Checked then
begin
s:=edit2.Text;
oraquery1.Close;
oraquery1.SQL.Text:='select a.personid,a.hname,b.hname,a.recordtime from y_jcyy_logpeccancy a ,j_jcyy_peccancytype b where a.peccancytypeid = b.id and a.hname like'''+s+'''';
oraquery1.Open ;
end;
if checkbox1.Checked and checkbox2.Checked then
begin
s:=edit1.Text;
t:=edit2.Text;
oraquery1.Close;
oraquery1.SQL.Text:='select a.personid,a.hname,b.hname,a.recordtime from y_jcyy_logpeccancy a ,j_jcyy_peccancytype b where a.peccancytypeid = b.id and (a.hname ='''+t+''') and (a.personid='''+s+''')';
oraquery1.Open;
end;
if checkbox3.Checked then
begin
oraquery1.Close;
oraquery1.SQL.Text:='select a.personid,a.hname,b.hname,a.recordtime from y_jcyy_logpeccancy a ,j_jcyy_peccancytype b where a.peccancytypeid = b.id and (b.hname ='''+combobox1.Text+''')';
oraquery1.Open;
end;
end;
解决方案 »
- vc写的一个ocx控件,其中有一个集合的调用。在vb下调用正常,然后在delphi下就报如下错误。
- GSM网络 移动通信 西门子 Power CP(CP113E) 告警提取问题
- delphi怎样写省市县选择(像javascript那样)
- 一个关于窗体的简单问题,谢谢大家解答!
- 我的机器完蛋了,谁能帮忙看看?
- 如何判断datasource控件的dataset已经连接上Query了啊?
- COM+应用层和SQL数据库不在同一台电脑上的事务问题
- 请问各位大侠怎样把String型转换为PChar型?在线等,答案正确马上给分!
- 我需要编程技巧更需要。。。。。。
- 请教拨号上网的API函数?
- 紧急求助,Incompatible types: 'String' and 'TLabel'
- windows组件msmq不能安装
with oraquery1 do
begin
Close;
SQL.Text:='select a.personid,a.hname,b.hname,a.recordtime from y_jcyy_logpeccancya ,
j_jcyy_peccancytype b where a.peccancytypeid = b.id and '''+s+''' ';
end;if checkbox1.Checked then
begin
s:='a.personid='+edit1.Text;
oraquery1.Close;
oraquery1.Open;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
s,t,s2:string;
begin
oraquery1.Close;
if checkbox1.Checked then
begin
s:=edit1.Text;
s2:=' and a.personid='''+s+'''';
end;
if checkbox2.Checked then
begin
s:=edit2.Text;
s2:=' and a.hname like'''+s+'''';
end;
if checkbox1.Checked and checkbox2.Checked then
begin
s:=edit1.Text;
t:=edit2.Text;
s2:=' and (a.hname ='''+t+''') and (a.personid='''+s+''')';
end;
if checkbox3.Checked then
begin
s2:=' and (b.hname ='''+combobox1.Text+''')';
end; oraquery1.SQL.Text:='select a.personid,a.hname,b.hname,a.recordtime from y_jcyy_logpeccancy a ,j_jcyy_peccancytype b where a.peccancytypeid = b.id '+s2;
oraquery1.Open;
end;