; table1.Close;
table2.Close;
table3.Close;
with Mainform do
begin
// StatusBar.Panels[1].Text:='仪器库已关闭';
if MDIChildCount=1 then
StatusBar.Panels[1].Text:='';
end;
Action := caFree;
end;
procedure Tfrm_YQ_Lab.PageControl1Change(Sender: TObject);
begin
case PageControl1.ActivePageIndex of
0:begin
DataSource1.DataSet:=Table1;
Table1.Open;
end;
1:begin
DataSource1.DataSet:=Query1;
// AllRec;
end;
end;
end;
procedure Tfrm_YQ_Lab.SpeedButton2Click(Sender: TObject);
begin
AllRec;
end;
procedure Tfrm_YQ_Lab.SpeedButton1Click(Sender: TObject);
var
SQLStr,SQLAll,Log:String;
SQLTemp:Pchar;
arrstr:array[1..7]of String;
i,l:integer;
function getsth(CurrEdit:TEdit):boolean;
begin
result:=false;
if CurrEdit.Text<>'' then
result:=true;
end;
begin
SQLAll:='';
SQLStr:='SELECT * FROM "仪器库.db" WHERE ';
if RadioGroup1.ItemIndex=1 then Log:='OR' else Log:='AND';
if Getsth(Edit_name) then
arrstr[1]:='(仪器名称='''+Edit_name.Text+''')';
arrstr[2]:=ComboBox1.text;
if arrstr[2]<>'' then
arrstr[2]:='(状况='''+arrstr[2]+''')';
if Getsth(Edit_No) then
arrstr[3]:='(型号='''+Edit_No.Text+''')';
if Getsth(Edit_date) then
arrstr[4]:='(启用日期='''+Edit_date.Text+''')';
if GetSth(Edit_address) then
arrstr[5]:='(放置位置='''+Edit_address.Text+''')';
if GetSth(Edit_experi) then
arrstr[6]:='(所属实验='''+Edit_experi.Text+''')';
arrstr[7]:='';
for i:=1 to 6 do
begin
arrstr[7]:=arrstr[7]+arrstr[i];
if arrstr[i]<>'' then
SQLAll:=SQLAll+Log+arrstr[i];
end;
if arrstr[7]='' then
begin
showmessage('没有查询项目?');
exit;
end;