Parameters:
Delphi6.0, DB- MSSQL, ADO Connection;
I have table with > 3000000 records and ADODataSet (SELECT * FROM PTABLE WHERE LONG='Parameter') that return recordset with 1 up to 200 records. The result is displayed in DBGrid. I need to have numbers on every record in DBGrid. Example: If RecordSet have 20 records, they have to be numbered from 1,2 .. to 20. My aproach was to make calculated field and write onCalcField event where ADODataSet.FieldByName('CountNo').Value:=ADODataSet.RecNo.
Since RecNo is documented as property what is the actual position in resulting record set. I have result -1 for first record and OK for others, but when I add new record (with INSERT) and requery the ADODataSet, the numbers are not OK.
For example: Items in Invoice, and in DBgrid I want to numerate every item from 1 to N.
Anyone have same problem ?
Delphi6.0, DB- MSSQL, ADO Connection;
I have table with > 3000000 records and ADODataSet (SELECT * FROM PTABLE WHERE LONG='Parameter') that return recordset with 1 up to 200 records. The result is displayed in DBGrid. I need to have numbers on every record in DBGrid. Example: If RecordSet have 20 records, they have to be numbered from 1,2 .. to 20. My aproach was to make calculated field and write onCalcField event where ADODataSet.FieldByName('CountNo').Value:=ADODataSet.RecNo.
Since RecNo is documented as property what is the actual position in resulting record set. I have result -1 for first record and OK for others, but when I add new record (with INSERT) and requery the ADODataSet, the numbers are not OK.
For example: Items in Invoice, and in DBgrid I want to numerate every item from 1 to N.
Anyone have same problem ?