procedure TFrm0121.edtInCard(Sender: TObject);
var
Total,Sale : Real;
begin
With Query1 do
begin
Close;
Sql.Clear;
Sql.Text := 'select Card_No,Card_Name from MEMBER'+
'where Card_No =: PCard_No'+
' and Card_Name =: PCard_Na';
ParamByName('PCard_No').asstring := edit2.text;
ParamByName('PCard_Name').asstring := edit1.text;
ParamByName('PCard_Name').asstring := edit3.text;
Open;
Close;
end;
With Query1 do
begin
Close;
Sql.Clear;
Sql.add ('select * from SANG');
Open;
//구매금액계산
//Sale := 수량 * 단가
//Total := Total + sale
Sale := FieldByName('Sang_Su').asstring * FieldByName ('Sang_Dan').asstring;
Total := Total + Sale;
FieldByName('Sang_Gu').asstring := Sale ;
FieldByName('Sang_Hanp').asstring := Total;
DBGrid1.Columns[0].Field := Table1.FieldByName('Sang_Name');
DBGrid1.Columns[1].Field := Table1.FieldByName('Sang_Dan');
DBGrid1.Columns[2].Field := Table1.FieldByName('Sang_Su');
DBGrid1.Columns[3].Field := Table1.FieldByName('Sang_Gu');
DBGrid1.Columns[4].Field := Table1.FieldByName('Sang_Hap');
Close;
end;
end;
어디서 에러가 난거죠???
부탁합니다..
감사합니다....
지금 대로 하면 Member하고 Where가 붙게 되죠.
다음과 같이 써 보세요.
Sql.Text := 'select Card_No,Card_Name from MEMBER'+
' where Card_No =: PCard_No'+
그럼 즐겁게 프로그램 작성하세요.
델아기 께서 말씀하시기를...
> procedure TFrm0121.edtInCard(Sender: TObject);
> var
> Total,Sale : Real;
> begin
> With Query1 do
> begin
> Close;
> Sql.Clear;
> Sql.Text := 'select Card_No,Card_Name from MEMBER'+
> 'where Card_No =: PCard_No'+
> ' and Card_Name =: PCard_Na';
> ParamByName('PCard_No').asstring := edit2.text;
> ParamByName('PCard_Name').asstring := edit1.text;
> ParamByName('PCard_Name').asstring := edit3.text;
> Open;
> Close;
> end;
> With Query1 do
> begin
> Close;
> Sql.Clear;
> Sql.add ('select * from SANG');
> Open;
> //구매금액계산
> //Sale := 수량 * 단가
> //Total := Total + sale
> Sale := FieldByName('Sang_Su').asstring * FieldByName ('Sang_Dan').asstring;
> Total := Total + Sale;
> FieldByName('Sang_Gu').asstring := Sale ;
> FieldByName('Sang_Hanp').asstring := Total;
> DBGrid1.Columns[0].Field := Table1.FieldByName('Sang_Name');
> DBGrid1.Columns[1].Field := Table1.FieldByName('Sang_Dan');
> DBGrid1.Columns[2].Field := Table1.FieldByName('Sang_Su');
> DBGrid1.Columns[3].Field := Table1.FieldByName('Sang_Gu');
> DBGrid1.Columns[4].Field := Table1.FieldByName('Sang_Hap');
> Close;
> end;
> end;
>
> 어디서 에러가 난거죠???
> 부탁합니다..
> 감사합니다....
>