标志=0 if 有数据输入 then begin 连接进条件中 where ...... 标志=1 end if 有数据输入 then if 标志=0 then begin 连接进条件中 where ...... 标志=1 end else 连接进条件中,连接的时候看你需要的是and 还是 or,即为and ...或者or ...这样下去就成了! 呵呵!
} unit untFind;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,ComCtrls, StdCtrls,ExtCtrls,Buttons,DBGridEh,DB,ADODB,untCommon,iniFiles,DBClient;Type TFindFrm = class(TForm) private DateTimePicker: TDateTimePicker; CboValueList: TComboBox; LookupSpbtn:TSpeedButton; FSql: string; FleftPanel: TPanel; PageControl1: TPageControl; TabSheet1: TTabSheet; TabSheet2: TTabSheet; Panel1: TPanel; BitBtn1: TSpeedButton; BitBtn2: TSpeedButton; CboFieldDesc: TComboBox; CboFieldName: TComboBox; CboEquDesc: TComboBox; CboEquName: TComboBox; Edit1: TEdit; RichEdit1: TRichEdit; BitBtn4: TSpeedButton; BitBtn3: TSpeedButton; RadioButton1: TRadioButton; RadioButton2: TRadioButton; ListBox1: TListBox; ListBox3: TListBox; SpeedButton1: TSpeedButton; SpeedButton2: TSpeedButton; ListBox2: TListBox; RadioButton3: TRadioButton; RadioButton4: TRadioButton; RichEdit2: TRichEdit; FObjectGrid: TDBGridEh; FTableName: string; FImageList: TImageList; FAttachSql: string; procedure PopupLookupFrm(Sender:TObject); procedure valueOnChange(Sender:TObject); procedure CboFieldDescOnChange(Sender:TObject); procedure ListBox1DblClick(Sender: TObject); procedure ListBox2DblClick(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); procedure SpeedButton2Click(Sender: TObject); procedure BitBtn3Click(Sender: TObject); procedure BitBtn4Click(Sender: TObject); procedure BitBtn2Click(Sender: TObject); procedure BitBtn1Click(Sender: TObject); procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure SetSql(const Value: string); procedure SetObjectGrid(const Value: TDBGridEh); procedure SetTableName(const Value: string); procedure SetImageList(const Value: TImageList); function GetSqlDesc: string; procedure SetAttachSql(const Value: string); procedure DisableKeyPress(Sender: TObject; var Key: Char); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; property ObjectGrid: TDBGridEh read FObjectGrid write SetObjectGrid; property TableName:string read FTableName write SetTableName; property Sql: string read FSql write SetSql; property SqlDesc:string read GetSqlDesc; property ImageList:TImageList read FImageList write SetImageList; //附加的sql条件 property AttachSql:string read FAttachSql write SetAttachSql; end;var FindFrm:TFindFrm; implementationuses Untget;{ TFindFrm }procedure TFindFrm.BitBtn1Click(Sender: TObject); var i, n: integer; OrderStr, ListStr, TName, FieldName, FieldValue: string; begin if RichEdit1.Lines.Text <> '' then Sql := 'SELECT * FROM ' + Self.TableName + ' WHERE ' + trim(RichEdit2.Text) else Sql := 'SELECT * FROM ' + Self.TableName + ' WHERE 1=1'; if self.AttachSql <> '' then Sql := Sql + self.AttachSql; //orderby if ListBox2.Items.Text <> '' then for i := 0 to ListBox2.Items.Count - 1 do begin //查找Field的实际名称 for n := 0 to CboFieldDesc.Items.Count-1 do if ListBox2.Items[i]= CboFieldDesc.Items[n] then begin ListStr := CboFieldname.Items[n]; break; end; if i = 0 then OrderStr := ListStr else OrderStr := OrderStr + ',' + ListStr; end; //dsc if OrderStr <> '' then begin if RadioButton3.Checked = True then OrderStr := ' ORDER BY ' + OrderStr + ' ASC' else OrderStr := ' ORDER BY ' + OrderStr + ' DESC'; end; Sql := Sql + OrderStr; //Application.MessageBox(Pchar(sql),'',0); if Sql<>'' then begin SCreen.Cursor := crHourGlass; if self.ObjectGrid.DataSource.DataSet.Active then self.ObjectGrid.DataSource.DataSet.Close; if self.ObjectGrid.DataSource.DataSet is TADODataSet then TADODataSet(self.ObjectGrid.DataSource.DataSet).CommandText := Sql; if self.ObjectGrid.DataSource.DataSet is TClientDataSet then TClientDataSet(self.ObjectGrid.DataSource.DataSet).CommandText := Sql; self.ObjectGrid.DataSource.DataSet.Open; SCreen.Cursor := crDefault; end; self.Close; end;
procedure TFindFrm.BitBtn2Click(Sender: TObject); begin Sql := ''; self.Close; end;procedure TFindFrm.BitBtn3Click(Sender: TObject); var aa, bb,fieldName,fieldEqu,fieldValue: string; begin if RichEdit1.Lines.Text = '' then begin aa := ''; bb := ''; end else begin if RadioButton1.Checked = True then begin aa := 'AND'; bb := RadioButton1.Caption; end else begin aa := 'OR'; bb := RadioButton2.Caption; end; end; fieldName := CboFieldName.Items[CboFieldDesc.ItemIndex]; fieldEqu := CboEquName.Items[CboEquDesc.ItemIndex]; if self.ObjectGrid.Columns[CboFieldDesc.ItemIndex].FieldName <> CboFieldName.Items[CboFieldDesc.ItemIndex] then fieldValue := edit1.Hint else fieldValue := edit1.Text;
if fieldEqu = 'LIKE' then fieldValue := '%'+trim(fieldValue)+'%'; //实际的sql语句 if self.CboValueList.Visible then RichEdit2.Text := RichEdit2.Text + ' ' + aa + ' ' + '(' + fieldName + ' ' + fieldEqu + ' ' + '''' + inttostr(CboValueList.ItemIndex) + ''')' else RichEdit2.Text := RichEdit2.Text + ' ' + aa + ' ' + '(' + fieldName + ' ' + fieldEqu + ' ' + '''' + fieldValue + ''')'; //显示给用户的语句 RichEdit1.Text := RichEdit1.Text + ' ' + bb + ' ' + '(' + CboFieldDesc.Text+ ' ' + CboEquDesc.Text + ' ' + '''' + Edit1.Text + ''')'; end;procedure TFindFrm.BitBtn4Click(Sender: TObject); begin RichEdit2.Text := ''; RichEdit1.Text := ''; end;procedure TFindFrm.CboFieldDescOnChange(Sender: TObject); var i:integer; begin if self.ObjectGrid.Columns[CboFieldDesc.ItemIndex].Field.DataType = ftDateTime then begin Edit1.Visible := false; DateTimePicker.Visible := true; CboValueList.Visible := false; end else if self.ObjectGrid.Columns[CboFieldDesc.ItemIndex].FieldName <> CboFieldName.Items[CboFieldDesc.ItemIndex] then begin Edit1.Visible :=True; Edit1.Width := 110; DateTimePicker.Visible := false; CboValueList.Visible := false; LookupSpbtn.Visible := True; LookupSpbtn.Top := Edit1.Top; LookupSpbtn.Left := Edit1.Left + Edit1.Width; end else begin Edit1.Visible := true; DateTimePicker.Visible := false; CboValueList.Visible := false; Edit1.Width := 130; end; end;
我的方法就是
tempsql:=tempsql+条件,把所有的条件加上后
execsql 就可了
if 有数据输入 then
begin
连接进条件中 where ......
标志=1
end
if 有数据输入 then
if 标志=0 then
begin
连接进条件中 where ......
标志=1
end
else
连接进条件中,连接的时候看你需要的是and 还是 or,即为and ...或者or ...这样下去就成了!
呵呵!
最后提交这个sql语句执行就ok了
给你一个思路:
与后台的TABLE相联系,生成不同的SQL语句,然后EXEC就可以了.
try
FindFrm := TFindFrm.Create(self);
FindFrm.TableName := 'TwmStockIn';
FindFrm.ImageList := self.iml16;
FindFrm.ObjectGrid := self.dbgItems;
FindFrm.ShowModal;
finally
FindFrm.Free;
end;
}
unit untFind;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,ComCtrls,
StdCtrls,ExtCtrls,Buttons,DBGridEh,DB,ADODB,untCommon,iniFiles,DBClient;Type
TFindFrm = class(TForm)
private
DateTimePicker: TDateTimePicker;
CboValueList: TComboBox;
LookupSpbtn:TSpeedButton;
FSql: string;
FleftPanel: TPanel;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
Panel1: TPanel;
BitBtn1: TSpeedButton;
BitBtn2: TSpeedButton;
CboFieldDesc: TComboBox;
CboFieldName: TComboBox;
CboEquDesc: TComboBox;
CboEquName: TComboBox;
Edit1: TEdit;
RichEdit1: TRichEdit;
BitBtn4: TSpeedButton;
BitBtn3: TSpeedButton;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
ListBox1: TListBox;
ListBox3: TListBox;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
ListBox2: TListBox;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
RichEdit2: TRichEdit;
FObjectGrid: TDBGridEh;
FTableName: string;
FImageList: TImageList;
FAttachSql: string;
procedure PopupLookupFrm(Sender:TObject);
procedure valueOnChange(Sender:TObject);
procedure CboFieldDescOnChange(Sender:TObject);
procedure ListBox1DblClick(Sender: TObject);
procedure ListBox2DblClick(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure SetSql(const Value: string);
procedure SetObjectGrid(const Value: TDBGridEh);
procedure SetTableName(const Value: string);
procedure SetImageList(const Value: TImageList);
function GetSqlDesc: string;
procedure SetAttachSql(const Value: string);
procedure DisableKeyPress(Sender: TObject; var Key: Char);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property ObjectGrid: TDBGridEh read FObjectGrid write SetObjectGrid;
property TableName:string read FTableName write SetTableName;
property Sql: string read FSql write SetSql;
property SqlDesc:string read GetSqlDesc;
property ImageList:TImageList read FImageList write SetImageList; //附加的sql条件
property AttachSql:string read FAttachSql write SetAttachSql;
end;var
FindFrm:TFindFrm;
implementationuses Untget;{ TFindFrm }procedure TFindFrm.BitBtn1Click(Sender: TObject);
var
i, n: integer;
OrderStr, ListStr, TName, FieldName, FieldValue: string;
begin
if RichEdit1.Lines.Text <> '' then
Sql := 'SELECT * FROM ' + Self.TableName + ' WHERE ' + trim(RichEdit2.Text)
else
Sql := 'SELECT * FROM ' + Self.TableName + ' WHERE 1=1'; if self.AttachSql <> '' then
Sql := Sql + self.AttachSql; //orderby
if ListBox2.Items.Text <> '' then
for i := 0 to ListBox2.Items.Count - 1 do
begin
//查找Field的实际名称
for n := 0 to CboFieldDesc.Items.Count-1 do
if ListBox2.Items[i]= CboFieldDesc.Items[n] then
begin
ListStr := CboFieldname.Items[n];
break;
end;
if i = 0 then
OrderStr := ListStr
else
OrderStr := OrderStr + ',' + ListStr;
end;
//dsc
if OrderStr <> '' then
begin
if RadioButton3.Checked = True then
OrderStr := ' ORDER BY ' + OrderStr + ' ASC'
else
OrderStr := ' ORDER BY ' + OrderStr + ' DESC';
end;
Sql := Sql + OrderStr; //Application.MessageBox(Pchar(sql),'',0); if Sql<>'' then
begin
SCreen.Cursor := crHourGlass; if self.ObjectGrid.DataSource.DataSet.Active then
self.ObjectGrid.DataSource.DataSet.Close; if self.ObjectGrid.DataSource.DataSet is TADODataSet then
TADODataSet(self.ObjectGrid.DataSource.DataSet).CommandText := Sql;
if self.ObjectGrid.DataSource.DataSet is TClientDataSet then
TClientDataSet(self.ObjectGrid.DataSource.DataSet).CommandText := Sql;
self.ObjectGrid.DataSource.DataSet.Open; SCreen.Cursor := crDefault;
end; self.Close;
end;
begin
Sql := '';
self.Close;
end;procedure TFindFrm.BitBtn3Click(Sender: TObject);
var
aa, bb,fieldName,fieldEqu,fieldValue: string;
begin
if RichEdit1.Lines.Text = '' then
begin
aa := '';
bb := '';
end
else
begin
if RadioButton1.Checked = True then
begin
aa := 'AND';
bb := RadioButton1.Caption;
end
else
begin
aa := 'OR';
bb := RadioButton2.Caption;
end;
end;
fieldName := CboFieldName.Items[CboFieldDesc.ItemIndex];
fieldEqu := CboEquName.Items[CboEquDesc.ItemIndex]; if self.ObjectGrid.Columns[CboFieldDesc.ItemIndex].FieldName <> CboFieldName.Items[CboFieldDesc.ItemIndex] then
fieldValue := edit1.Hint
else
fieldValue := edit1.Text;
if fieldEqu = 'LIKE' then
fieldValue := '%'+trim(fieldValue)+'%';
//实际的sql语句
if self.CboValueList.Visible then
RichEdit2.Text := RichEdit2.Text + ' ' + aa + ' ' + '(' + fieldName + ' ' + fieldEqu + ' ' + '''' + inttostr(CboValueList.ItemIndex) + ''')'
else
RichEdit2.Text := RichEdit2.Text + ' ' + aa + ' ' + '(' + fieldName + ' ' + fieldEqu + ' ' + '''' + fieldValue + ''')';
//显示给用户的语句
RichEdit1.Text := RichEdit1.Text + ' ' + bb + ' ' + '(' + CboFieldDesc.Text+ ' ' + CboEquDesc.Text + ' ' + '''' + Edit1.Text + ''')';
end;procedure TFindFrm.BitBtn4Click(Sender: TObject);
begin
RichEdit2.Text := '';
RichEdit1.Text := '';
end;procedure TFindFrm.CboFieldDescOnChange(Sender: TObject);
var
i:integer;
begin
if self.ObjectGrid.Columns[CboFieldDesc.ItemIndex].Field.DataType = ftDateTime then
begin
Edit1.Visible := false;
DateTimePicker.Visible := true;
CboValueList.Visible := false;
end
else if self.ObjectGrid.Columns[CboFieldDesc.ItemIndex].FieldName <> CboFieldName.Items[CboFieldDesc.ItemIndex] then
begin
Edit1.Visible :=True;
Edit1.Width := 110;
DateTimePicker.Visible := false;
CboValueList.Visible := false;
LookupSpbtn.Visible := True;
LookupSpbtn.Top := Edit1.Top;
LookupSpbtn.Left := Edit1.Left + Edit1.Width;
end
else
begin
Edit1.Visible := true;
DateTimePicker.Visible := false;
CboValueList.Visible := false;
Edit1.Width := 130;
end;
end;
var
strLngPath,iniPath:string;
iniFile:TIniFile;
LanguageType:integer;
begin
inherited CreateNew(AOwner); self.Name := 'frmFind';
self.Position := poOwnerFormCenter;
self.BorderIcons :=[biSystemMenu];
self.Width :=380;
self.Height:=380;
self.AutoScroll:=false; FImageList := TImageList.Create(self);
self.Icon.Assign(TForm(AOwner).Icon); self.Caption := '查找'; SpeedButton1 := TSpeedButton.Create(self);
SpeedButton1.Name := 'SpeedButton1';
SpeedButton1.Parent := self;
with SpeedButton1 do
begin
Left := 170;
Top := 220;
Width := 23;
Height := 22;
Flat := True;
OnClick := SpeedButton1Click;
end;
SpeedButton2 := TSpeedButton.Create(self);
SpeedButton2.Name := 'SpeedButton2';
SpeedButton2.Parent := self;
with SpeedButton2 do
begin
Left := 170;
Top := 250;
Width := 23;
Height := 22;
Flat := True;
OnClick := SpeedButton2Click;
end;
CboFieldDesc := TComboBox.Create(self);
CboFieldDesc.Name := 'CboFieldDesc';
CboFieldDesc.parent := self;
CboFieldDesc.Left := 0;
CboFieldDesc.Top := 2;
CboFieldDesc.Width := 160;
CboFieldDesc.OnChange := self.CboFieldDescOnChange;
CboFieldDesc.OnKeyPress := self.DisableKeyPress; CboFieldName := TComboBox.Create(self);
CboFieldName.Name := 'CboFieldName';
CboFieldName.Parent := self;
CboFieldName.Visible := false; CboEquDesc := TComboBox.Create(self);
CboEquDesc.Name := 'CboEquDesc';
CboEquDesc.parent := self;
CboEquDesc.Left := 163;
CboEquDesc.Top := 2;
CboEquDesc.Width := 65;
CboEquDesc.Items.Add('等于');
CboEquDesc.Items.Add('大于');
CboEquDesc.Items.Add('小于');
CboEquDesc.Items.Add('不等于');
CboEquDesc.Items.Add('可能为');
CboEquDesc.OnKeyPress := self.DisableKeyPress; CboEquName := TComboBox.Create(self);
CboEquName.Name := 'CboEquName';
CboEquName.parent := self;
CboEquName.Items.Add('=');
CboEquName.Items.Add('>');
CboEquName.Items.Add('<');
CboEquName.Items.Add('<>');
CboEquName.Items.Add('LIKE');
CboEquName.Visible := false; //输入值可以有三种方式,1、日期形,2、值域
Edit1 := TEdit.Create(self);
Edit1.Parent := self;
Edit1.Left := 228;
Edit1.Top := 2;
Edit1.Width := 130; DateTimePicker := TDateTimePicker.Create(self);
DateTimePicker.Parent := self;
DateTimePicker.Left := 228;
DateTimePicker.Top := 2;
DateTimePicker.Width := 130;
DateTimePicker.Visible := false;
DateTimePicker.OnChange := self.valueOnChange; CboValueList := TComboBox.Create(self);
CboValueList.Parent := self;
CboValueList.Left := 228;
CboValueList.Top := 2;
CboValueList.Width := 130;
CboValueList.Visible := false;
CboValueList.OnChange := self.valueOnChange; LookupSpbtn := TSpeedButton.Create(self);
LookupSpbtn.Name := 'LookupSpbtn';
LookupSpbtn.Parent := self;
LookupSpbtn.Visible := false;
LookupSpbtn.Flat := True;
LookupSpbtn.OnClick := self.PopupLookupFrm; RichEdit1 := TRichEdit.Create(self);
RichEdit1.Parent := self;
RichEdit1.ReadOnly := true;
RichEdit1.Left := 0;
RichEdit1.Top := 50;
RichEdit1.Width := 360;
RichEdit1.Height := 110; BitBtn4 := TSpeedButton.Create(self);
BitBtn4.Name := 'BitBtn4';
BitBtn4.Parent := self;
BitBtn4.Caption := '清空';
BitBtn4.Left := 280;
BitBtn4.Top := 24;
BitBtn4.Width := 75;
BitBtn4.Flat := true;
BitBtn4.OnClick := BitBtn4Click; BitBtn3 := TSpeedButton.Create(self);
BitBtn3.Name := 'BitBtn3';
BitBtn3.Parent := self;
BitBtn3.Caption := '添加';
BitBtn3.Left := 200;
BitBtn3.Top := 24;
BitBtn3.Width := 75;
BitBtn3.Flat := true;
BitBtn3.OnClick := BitBtn3Click;
RadioButton1 := TRadioButton.Create(self);
RadioButton1.Name := 'RadioButton1';
RadioButton1.parent := self;
RadioButton1.Top := 30;
RadioButton1.Width := 46;
RadioButton1.Caption := '并且';
RadioButton1.Checked := true; RadioButton2 := TRadioButton.Create(self);
RadioButton2.Name := 'RadioButton2';
RadioButton2.parent := self;
RadioButton2.Top := 30;
RadioButton2.Left := 50;
RadioButton2.Width := 46;
RadioButton2.Caption := '或者'; ListBox1 := TListBox.Create(self);
ListBox1.Parent := self;
ListBox1.Left := 0;
ListBox1.Top := 193;
ListBox1.Width := 171;
ListBox1.Height := 105;
ListBox1.OnDblClick := ListBox1DblClick; ListBox2 := TListBox.Create(self);
ListBox2.Parent := self;
ListBox2.Left := 190;
ListBox2.Top := 193;
ListBox2.Width := 171;
ListBox2.Height := 105;
ListBox2.OnDblClick := ListBox2DblClick; RadioButton3 := TRadioButton.Create(self);
RadioButton3.Name := 'RadioButton3';
RadioButton3.parent := self;
RadioButton3.Left := 200;
RadioButton3.Top := 170;
RadioButton3.Caption := '升序';//TMainFrm(AOwner).UIConfig.GetDisplayLabel('msg_asc'); RadioButton4 := TRadioButton.Create(self);
RadioButton4.Name := 'RadioButton4';
RadioButton4.parent := self;
RadioButton4.Left := 250;
RadioButton4.Top := 170;
RadioButton4.Caption := '降序';//TMainFrm(AOwner).UIConfig.GetDisplayLabel('msg_desc'); RichEdit2 := TRichEdit.Create(self);
RichEdit2.Parent := self;
with RichEdit2 do
begin
Left := 282;
Top := 96;
Width := 185;
Height := 89;
Font.Charset := GB2312_CHARSET;
Font.Color := clWindowText;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
Lines.Text := '';
ParentFont := False;
TabOrder := 12;
Visible := False;
end;
Panel1 := TPanel.Create(self);
Panel1.Parent := self;
Panel1.BevelOuter := bvNone;
with Panel1 do
begin
Left := 0;
Top := 432;
Width := 181;
Height := 41;
Align := alBottom;
TabOrder := 1;
end;
BitBtn1 := TSpeedButton.Create(self);
BitBtn1.Name := 'BitBtn1';
BitBtn1.Parent := Panel1;
with BitBtn1 do
begin
Left := 90;
Top := 8;
Width := 75;
Height := 25;
Caption := '确定';//TMainFrm(AOwner).UIConfig.GetDisplayLabel('msg_Ok');;
TabOrder := 0;
//Flat := True;
OnClick := BitBtn1Click;
end;
BitBtn2 := TSpeedButton.Create(self);
BitBtn2.Name := 'BitBtn2';
BitBtn2.Parent := Panel1;
with BitBtn2 do
begin
Left := 186;
Top := 8;
Width := 75;
Height := 25;
Caption := '取消';//TMainFrm(AOwner).UIConfig.GetDisplayLabel('msg_cancle');
TabOrder := 1;
//Flat := True;
OnClick := BitBtn2Click;
end; //读取语言选项
{ iniPath := ExtractFilePath(Application.ExeName)+'ingenTechhr.ini';
strLngPath:=ExtractFilePath(Application.ExeName)+'Language\'; iniFile := TIniFile.Create(iniPath); LanguageType := iniFile.ReadInteger('App','Language',0); case LanguageType of
0:
SetLanguage(self,strLngPath+'Gb.ini');
1:
begin
self.Font.Charset := CHINESEBIG5_CHARSET;
SetLanguage(self,strLngPath+'Big5.ini');
end;
2:
SetLanguage(self,strLngPath+'English.ini');
end; }
end;
1、能适用不同类型的数据库,比如Oracle、MS SQL、paradox、access...等等,用列表框通过获取BDE、ODBC所有名称,来选择要查询的数据库,注意不同数据库“SQL”的差别。
2、获取当前数据库的所有表名到列表框,让用户选择表名。表名可用中文字典替换显示。
3、获取该表的所有字段,让用户能选择要查询的字段,字段名可用中文字典替换显示。要包括排序。
4、做一个查询条件组合工具,可以组合任意多个条件,比如:>、=、>=、包含、在...之间、like、是否空、.....等等;
5、查询结果的处理:
(1)除了显示,可以转为Excel、DBF、HTML等常用格式;
(2)可以用数据字典实现西文字段到中文字段名的互换;
(3)可以指定X轴和1-n个Y轴字段绘制多种格式趋势图形,能保存、打印、实时设置格式等;
(4)能定制固定表格的关键字段列;
(5)可点击任意字段进行排序;
(6)在查询结果表格中双击字段时,单独开窗口显示,用于显示备注、图片等类型的字段。
6、其他功能:
实现自定义菜单功能,将常用表的查询设置选项(包括组合的条件)保存成菜单项,以便下次快速查询或修改;对于本地库,比如dbf、access、paradox等,可以直接选择文件进行查询;可以自定义SQL语句进行查询;其它功能就自己乱加吧。