TempStr:='';
query1.first
while not query1.eof do
begin
if query1.fieldbyname('a').asstring=TempStr then
begin
...
...
end;
TempStr:=query1.fieldbyname('a').asstring;
query1.next;
end;
yanghaijun:
我看过你(if it was you)写过一段 获得dbgrid某一行某一列内容的程序,
方法是使dbgrid.refresh,在 ondrawdatacell事件中处理。
可是我的dbgrid的列必须在设计阶段定义,则 ondrawdatacell不发生。
how should i do?tell me.
首先选取所有的c,
query1.Sql.append('select distinct(c) from abc');
Query1.open;
while not Query1.eof do begin
if StrInputC=Query1.FieldByName('c') then
begin
ShowMessage('c重复!');
exit;
end;
query1.Next;
end;
query1.Close;