Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

PROCEDURE AUTONUMBER procedure TFormMain.

DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); var vDbGrid: TDBGrid absolute Sender; begin // only do the next line if this event generated for // the first columnn (column with index 0) if DataCol=0 then vDbGrid.Canvas.TextOut(Rect.Left + 2 , Rect.Top + 2 , IntToStr(vDbGrid.DataSource.DataSet.RecNo));

PROCEDURE AUTONUMBER FROM QUERY


SET @rowno = 0; SELECT @rowno:=@rowno+1 as `rn`, `id`, `title`, `topic` FROM stories WHERE newstype='2';

You might also like