Mega Search
23.2 Million


Sign Up

Make a donation  
Access Violation at TIBCustomDataSet in XE4 [Edit]  
News Group: embarcadero.public.delphi.database.interbase_express

Hello,

I was using D6 until now and i have always used IBX. Now i'm putting the main project to work in XE4 and got this problem i can´t figure it out.

i have created a component and one of its functions is to print the dataset using reportbuilder. When i click to print, it does pop up the rbuilder results, but when dataset has too many entries i get this AV error. I click ok in AV popup, click "close" in rbuilder results ( which are ok ) and when it returns to my component window, the DBGRID is all messed ( buggy - all entries white cant see nothing but still can double click them). 

having no clue about it, i created the MAP FILE of my project and with the AV address i got the error on the TIBCustomDataSet unit, in "IsVisible" function , line 1924 which it's shown below :

function TIBCustomDataSet.IsVisible(Buffer: TRecBuf): Boolean;
begin
    result := True;
    if not (State = dsOldValue) then
      *result := (PRecordData(Buffer)^.rdCachedUpdateStatus in FUpdateRecordTypes) and*
        *(not ((PRecordData(Buffer)^.rdCachedUpdateStatus = cusUnmodified) and*
          *(PRecordData(Buffer)^.rdUpdateStatus = usDeleted))); <-- AV ERROR LINE given by map file*
end;

EDIT:
i splitted result attribution and the line giving me the AV error is : 

result := (PRecordData(Buffer)^.rdCachedUpdateStatus in FUpdateRecordTypes);


If my dataset has like 20 25 entries it works perfectly, anything more than that its gives me the AV error.


if i'm not dumb : 

AV address : $006D8D50
                   -
                    $00401000
                 ----------------------
                   $002D7D50

 0001:002D04A0 0000F41C C=CODE     S=.text    G=(none)   M=IBCustomDataSet ACBP=A9
 0001:002D7D44       IBCustomDataSet.TIBCustomDataSet.IsVisible
1924 0001:002D7D50

Any idea? any other information needed?

thanks in advance
/fferrandini

==========================================================================

The problem is something related to dataset being used at the same time for different purposes, i dont know i'm just guessing.

i say so because when i tested the problem today it took 3 rounds of printing to fire the AV error. So it couldnt be a code problem at all ( function code - not talking about freeing objects, pointers,...). And whenever the AV error is fired, the GRID back in the main form is always messed up, with blank spaces and all that.

what i did was to DisableControls of dataset before firing ppReport.print and EnableControls just after it. Now i dont have the AV error anymore, tested 30x in different datasets and works ok.

i still dont know exactly what was the problem, but i managed to control it. so to me, its ok ( i'm not happy but i have a lot of work pending)

Edited by: fernando ferrandini on May 12, 2014 6:46 AM

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 12-May-2014, at 9:53 AM EST
From: fernando ferrandini