
//166ҳԴ

Insert Into Customer(CustNo,Name,Country)
Values(:CustNo,:Name,:Country)


Query1.params[0].AsString := "1988";
Query1.params[1].AsString := "Lichtenstein";
Query1.params[2].AsString := "USA";


Query1.ParamByName('CustNo').AsString := "1988";
Query1.ParamByName('Name').AsString := "Lichtenstein";
Query1.ParamByName('Country').AsString := "USA";


Query1.Param.ParamValues['dept';name]:=VarArrayOf([StrToInt(Edit1.Text),Edit1.Text]);




//167ҳԴ

try
Query1.close;
Query1.SQL.clear;
Query1.SQL.Add(Memo1.text);
Query1.Open;
Except
  On  EdatabaseError  do  Query1.ExecSQL
end;



//177ҳԴ

var
i:integer;
begin
for i:=0 to (listbox1.items.count-1) do
begin
  if listbox1.selected[i] then
  begin
  table1.edit;
  //{listboxѡеݸǰ¼countryֶ}
  table1.FieldByName('country').asstring:=listbox1.items.string[i];
  table1.post;
  end;
end;
//{޸Ϻ󣬽listbox}
listbox1.visible:=false;
end;



//199ҳԴ

type 
  TDecisionDrawStates = (dsGroupStart, dsRowCaption, dsColCaption, dsSum, dsRowValue, dsColValue, dsData, dsOpenAfter, dsCloseAfter, dsRowIndicator, dsColIndicator, dsRowPlus, dsColPlus, dsNone);
  TDecisionDrawState = set of TDecisionDrawStates;
TDecisionDrawCellEvent = procedure (Sender: TObject; Col, Row: Longint; var Value: string; var AFont: TFont; var AColor: TColor; AState: TGridDrawState; ADrawState: TDecisionDrawState) of object;
property OnDecisionDrawCell: TDecisionDrawCellEvent;



//199-200ҳԴ

var
flag:integer;
begin
if  aDrawstate=[dsData]  then
      begin
        if  Strtoint(Value)<3000  then
                 flag:=1
                 else
                 flag:=2;
       case  flag  of
           1:  Acolor:=clRed;
           2:  Acolor:=clBlue;
       end;
     end;
end;



//204ҳԴ

if adrawstate=[dsdata] then
  begin
   if value<>'' then
     begin
       if strtoint(value)<3000 then
         acolor:=claqua
       else
         acolor:=clyellow;
     end;
  end;

//ͳݵԪıɫ
if adrawstate=[dssum,dsdata] then
  begin
    if strtofloat(value)<3000 then
      acolor:=claqua
    else
      acolor:=clyellow;
    if strtofloat(value)>10000.0 then
      acolor:=clred;
  end;
end;


