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;
解决方案 »
- Inno setup 打包的一个问题
- WebBrowser1,自动登录的问题
- 關于按鈕控件快捷鍵的問題!
- 高分请教: 怎样用BDE Administrator连上MS SQL Server2000???
- Indy9 安装失败,致此向各位讨教Indy9安装步骤!
- 请教DELPHI高手!ADOQUERY使用DELETE语句报些不知道的错误!
- 请高手指点,一定进来看看。在线等待!
- 有谁知道什么地方可以免费上传软件供人试用?我有一个软件想发表!
- 求教:如何关闭MDI子窗口
- 谁有用mci写多媒体软件的例子,能否给兄弟一个做参考!是要写作业!
- 紧急求助,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;