看看吧,大哥,???我觉得这里的都是高手呀,都比我牛呀!(13分)

  • 主题发起人 hnzcg124
  • 开始时间
H

hnzcg124

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure Tsb_jlqjzjgl_cx.DBDateTimeEditEh2Change(Sender: TObject);
begin
str3:='';
combobox10.Enabled:=true;combobox4.Enabled:=false;
if (combobox3.text='购进日期')or(combobox3.Text='检定时间')then
begin
if dbdatetimeediteh2.Text<>' - - ' then
str3:=str3+i3+' '+trim(combobox4.Text)+' '+''''+trim(dbdatetimeediteh2.Text)+''''
else
str3:=str3+i3+' '+trim(combobox4.Text)+' '+'''';
end;
end;/时间控件的响应事件
procedure Tsb_jlqjzjgl_cx.Edit2Change(Sender: TObject);
begin
str3:='';
if trim(edit2.Text)<>'' then
begin
combobox10.Enabled:=true;
end
else
begin
combobox10.Enabled:=false;
end;
if combobox4.Text='模糊查询'then
str3:=str3+i3+' '+' like '+' '+''''+trim(edit2.Text)+'%'+''''
else
str3:=str3+i3+' '+trim(combobox4.Text)+' '+''''+trim(edit2.text)+'''';
end;//edit2的响应事件
//combobox10可能用到上面两这种的其一所以在它的事件里面写了量的事件,到底要不要写呢?因为这时多条件查询的问题,还可能涉及到下面的条件,参见下面的查询框架
procedure Tsb_jlqjzjgl_cx.ComboBox10Change(Sender: TObject);
begin
//设置查询条件
str3:=' ';
if combobox4.Text='模糊查询' then
begin
str3:=i3+' '+' like '+' '+''''+trim(edit2.Text)+'%'+'''';
end
else
begin
str3:=i3+' '+trim(combobox4.Text)+' '+''''+trim(edit2.Text)+'''';
end;
dbdatetimeediteh2change(nil);//可以这样用吗?大哥?
{if (combobox3.text='购进日期')or(combobox3.Text='检定时间')then
begin
str3:=i3+' '+trim(combobox4.Text)+' '+''''+trim(dbdatetimeediteh2.Text)+'''';
end;}
case combobox10.ItemIndex of
0: str3:=str3+' and ';
1: str3:=STR3+' OR ';
END;
end;


请问一下有以下的四个条件要实现复合查询怎么办?
combobox1(表中的字段)combobox11(查询时的条件)edit1(输入查询的内容) combobox111(符合条件)
combobox2(表中的字段)combobox22(查询时的条件)edit2(输入查询的内容) combobox222(符合条件)
combobox3(表中的字段)combobox22(查询时的条件)edit3(输入查询的内容) combobox333(符合条件)
combobox4(表中的字段)combobox44(查询时的条件)edit4(输入查询的内容) combobox444(符合条件)
其中他们每一列的值都相同,目的为了处理表中有非常多的记录时的查询
另外还要考虑时间类型和单条件时的查询
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
609
import
I
顶部