Re: Is MoveFirst() required before Seek() to perform seek-and-scan?
- From: "Paul Baker" <paulb@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 3 Feb 2006 13:03:44 -0500
I corrected myself in a later post - Borland is trying to go to BOF for
consistency with other database engines.
It would seem that the caller may not assume anything about the state of the
newly opened recordset.
Paul
"Stephen Howe" <sjhoweATdialDOTpipexDOTcom> wrote in message
news:OJB2hkLKGHA.524@xxxxxxxxxxxxxxxxxxxxxxx
procedure TCustomADODataSet.InternalFirst;
begin
if not Recordset.BOF then
begin
Recordset.MoveFirst;
if Recordset.Supports(adMovePrevious) and not Recordset.BOF then
Recordset.MovePrevious;
end;
end;
It is called after the recordset is opened. They go to great lengths to
try to be on the first record!
I don't think they are.
If you look at the code above, they are trying to be at BOF if they can.
BOF is _not_ the first record. It is before it.
That is what that MovePrevious is about - having doen a MoveFirst the code
tries to be at BOF if it is not already.
However, where is it documented what state the newly opened recordset
should be in? It seems to me that BOF or the first record are both things
an OLE DB Provider could be forgiven for doing in the absence of any
mandate.
I think you are right. I am just guessing here, but I think the situation
with ADO is such that
server-sided cursors : probably up to database as to whether on first
record or at BOF
client-sided cursors : on first record (if there is any)
Stephen Howe
.
- References:
- Re: Is MoveFirst() required before Seek() to perform seek-and-scan?
- From: Paul Baker
- Re: Is MoveFirst() required before Seek() to perform seek-and-scan?
- From: Stephen Howe
- Re: Is MoveFirst() required before Seek() to perform seek-and-scan?
- Prev by Date: Re: RecordSet.Close Throwing Errors
- Next by Date: CADORecordBinding
- Previous by thread: Re: Is MoveFirst() required before Seek() to perform seek-and-scan?
- Next by thread: Re: Is MoveFirst() required before Seek() to perform seek-and-scan?
- Index(es):
Relevant Pages
|
|