Problem with OnCalcFields() Event.



Parameters:
Delphi6.0, DB- MSSQL, ADO Connection;

J have table with > 3000000 records and ADODataSet (SELECT * FROM
PTABLE WHERE LONG='Parameter') that return recordsets with 1..200
records. The result J display in DBGrid.
J need to have numbers on every record in DBGrid.
My aproach was to make calculated field and write onCalcField event
where ADODataSet.FieldByName('RecordNum').Value:=ADODataSet.RecNo.
Since RecNo is documented as function that returns the actual position
in resulting record set. J have result -1 for first record and OK for
others, but when J add new record and requery, the numbers are also not
well.
Anyone has same problem,

.



Relevant Pages

  • Local dataset show parts in two grids
    ... cursor), and I want to display some of the records in one DBGrid and the ... other in a second DBGrid depending on the value in one of the fields. ... just for display purposes, but these values change the way the grid cells ...
    (borland.public.delphi.database.ado)
  • detail table display order
    ... Using Microsoft Access 2000, ADO and D6 ... Am displaying data from a detail table in a dbgrid. ... composite primary key made up of a text field, ... When you display the detail table within access, ...
    (borland.public.delphi.database.ado)
  • Re: Capture controls to image from program
    ... I would like to capture a snapshot of a DBGrid from within my application and possibly display it in a TImage. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Capture controls to image from program
    ... I would like to capture a snapshot of a DBGrid from within my application and possibly display it in a TImage. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Dbgrid trigger
    ... to the DBGrid. ... Bill Todd (TeamB) ... Prev by Date: ...
    (borland.public.delphi.database.ado)