수고하십니다.
물어볼 질문을 요약하면,
Query(Query1) --> Datasource(SellDBS) --> Table(SellT) 연결이 되어 있으며,
Table안에 정렬되어 있는 값(Row:20개)들중에 조건(예: '홍길동')을 통해 얻은
값(Row:5개) 이라면 Query안에 담겨있는 첫번째'홍길동'으로 화살표(?)가 DBGrid에서
이동하게 하고 싶습니다. 아래는 간단한 코딩 부분입니다.(DB -파라독스)
with Mainmenu1.Query1 do begin
Close;
SQL.Clear;
SQL.Add('Select * From sell');
SQL.Add('where sang like :sang1');
ParamByName('sang1').AsString := '%' + sang.Text + '%';
Open;
IF Mainmenu1.Query1.Recordcount = 0 then begin
messageDlg('검색된 결과가 없습니다!',mtwarning,[mbok],0);
EXIT;
end;
mainmenu1.sellT.gotokey; <<<-------문제 있는곳???
end;
답변 부탁드립니다.
> 수고하십니다.
> 물어볼 질문을 요약하면,
> Query(Query1) --> Datasource(SellDBS) --> Table(SellT) 연결이 되어 있으며,
> Table안에 정렬되어 있는 값(Row:20개)들중에 조건(예: '홍길동')을 통해 얻은
> 값(Row:5개) 이라면 Query안에 담겨있는 첫번째'홍길동'으로 화살표(?)가 DBGrid에서
> 이동하게 하고 싶습니다. 아래는 간단한 코딩 부분입니다.(DB -파라독스)
>
> with Mainmenu1.Query1 do begin
> Close;
> SQL.Clear;
> SQL.Add('Select * From sell');
> SQL.Add('where sang like :sang1');
> ParamByName('sang1').AsString := '%' + sang.Text + '%';
> Open;
> IF Mainmenu1.Query1.Recordcount = 0 then begin
> messageDlg('검색된 결과가 없습니다!',mtwarning,[mbok],0);
> EXIT;
> end;
> mainmenu1.sellT.gotokey; <<<-------문제 있는곳???
> end;
>
> 답변 부탁드립니다.
이렇게 하면 될거 같네요
table은 datasource와 같이 연결하구 query는 datasource와 연결 끊고
> Query1.first;
> table1.FindKey([Query1.fieldbyname('sang').AsString]);