Re: Problem with OnCalcFields() Event.
- From: "Bjørge" <bjorge@xxxxxxxxxxxxxxx>
- Date: Tue, 4 Oct 2005 15:59:31 +0200
tanaskovskij@xxxxxxxxxxx wrote:
> 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,
There is no such thing as a RecNo before you have posted the record into the
database.
I wouldn't use the term RecNo for anything when working with a database
application. It's not a very "database-like" term, and many db engines have
no notion about such a "measure"; If it's for uniquely identifying a record,
the normal method would be assigning an ID, or using the row identificator.
--
Bjørge
.
- Follow-Ups:
- Re: Problem with OnCalcFields() Event.
- From: tanaskovskij
- Re: Problem with OnCalcFields() Event.
- References:
- Problem with OnCalcFields() Event.
- From: tanaskovskij
- Problem with OnCalcFields() Event.
- Prev by Date: Re: REG_BINARY
- Next by Date: Re: REG_BINARY
- Previous by thread: Problem with OnCalcFields() Event.
- Next by thread: Re: Problem with OnCalcFields() Event.
- Index(es):
Relevant Pages
|