Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: TAdQuery Post method Question
TAdQuery Post method Question
Posted: 2007/11/20 09:54
 
Hi,
I m experiencing a little problem with anyDac.
The TAdQuery post method seems to close the current record cursor.
Could you tell me if it s possible to avoid this behaviour .
Thanks in advance
Michael
Re:TAdQuery Post method Question
Posted: 2007/11/21 04:38
 
Hello

Sorry, but "close the current record cursor" is not clear for me. Could you explain it more, please ? May be some short code snippet ? Also, what are:
- your DBMS version
- your AnyDAC version

Regards,
Dmitry
Re:TAdQuery Post method Question
Posted: 2007/11/21 08:29
 
Hello,
I m using anydac v 1.12 on an Oracle db v 9i.
let s try to be a little bit more clear.

I am looping in a TADQuery and sometimes doing insert and post in this query.
after this call of the post method i think the cursor (I mean the cuurentl record) changes.

Another way to reprocude it :
while not Query.eof do
begin
Query.next;
end;
Query.insert; //Here Query.eof is still true => OK
....Affect some values ....
Query.post;//Here Query.eof is false => OK
Query.next;//Here Query.eof is false => NOT OK (In my Opinion) eof should be true.

NB :I could solve this issue inserting a Query.refresh beetween Post and Next :
while not Query.eof do
begin
Query.next;
end;
Query.insert; //Here Query.eof is still true => OK
....Affect some values ....
Query.post;//Here Query.eof is false => OK
Query.refresh;
Query.next;//Here Query.eof is true => OK
Re:TAdQuery Post method Question
Posted: 2007/11/22 02:16
 
Hello

Your expectation is wrong. Let say, we have 3 records. Then:

 while not Query.eof do   Query.next; // Query.RecNo = 3, Query.RecordCount = 3. EOF. Query.insert; Query.post; // Query.RecNo = 3, Query.RecordCount = 4. not EOF. Query.next// Query.RecNo = 4, Query.RecordCount = 4. not EOF. Query.next// Query.RecNo = 4, Query.RecordCount = 4. EOF.



That is correct dataset behaviour.

Regards,
Dmitry