I use Delphi 2007
Oracle 10G
Odac professional 6.25.0.12
windows XP SP2
OraSession.Direct := true
OraSession.optimizermode := omFirstRows
All oraquery have NonBlocking = true and FetchAll = true;
In my application i have one session that execute a query and display the resulset into a dbgrid, while the query is Executed i read
the RowsProcessed property and display the download status to the user with this code :
Code: Select all
procedure FillGrid;
begin
Query.NonBlocking := true;
Query.FetchAll := true;
Query.Open;
repeat
if PeekMessage(Msg, 0, 0, 0, PM_NOREMOVE) then
begin
PeekMessage(Msg, 0, 0, 0, PM_REMOVE);
if Msg.Message WM_QUIT then
begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end
else
Break;
end;
if not Aborted then
begin
lblDownloadData.Caption := Format('Download record %d di %d',[Query.RowsProcessed,NumRecord]);
end;
until not (Dataset.Fetching) or (Aborted);
if Aborted Then
Exit;
.....
end;
Code: Select all
procedure BreakQuery;
begin
Aborted := true;
if Query.Executing or Query.Fetching then
Query.BreakExec;
while Query.Executing or Query.Fetching do
Application.processMessage;
end;
but i got an exception like this :
date/time : 2007-12-07, 12:50:18, 870ms
operating system : Windows XP Service Pack 2 build 2600
system language : Italian
system up time : 4 hours 45 minutes
program up time : 1 minute 20 seconds
processors : 2x Intel(R) Pentium(R) 4 CPU 3.00GHz
physical memory : 519/1503 MB (free/total)
free disk space : (C:) 22.54 GB
display mode : 1280x1024, 32 bit
allocated memory : 24.62 MB
exec. date/time : 2007-12-07 12:48
version : 2.0.0.150
compiled with : BCB 2006
callstack crc : $c62644cd, $0be9b5b4, $ef0ea8f6
exception number : 1
exception class : EAssertionFailed
exception message : Assertion failure (D:\Projects\Delphi\Dac\Source\CRAccess.pas, line 1562).
main thread ($614):
005985e4 +020 Appz.exe CRAccess TCRRecordSet.CanDisconnect
005ad60b +03b Appz.exe DBAccess 2255 +0 TCustomDADataSet.DoOnAfterFetch
005d0fdf +127 Appz.exe OraClasses WndProc
7e3996c2 +00a USER32.dll DispatchMessageA
004e2ca0 +0fc Appz.exe Forms 8015 +23 TApplication.ProcessMessage
004e2cda +00a Appz.exe Forms 8034 +1 TApplication.HandleMessage
004e2f30 +0cc Appz.exe Forms 8125 +23 TApplication.Run
00e1b943 +12f Appz.exe Appz 236 +50 initialization
Wher is my mistake ?
Thans in advance Paolo