Access Violation on TfrxDBDataset.GetValue

Alex,

We are with problem of access violation in the line of the GetValue function of the TfrxDBDataSet component:

Result: = Field(Fields.Objects).value

Was everything functioning correctly until installing version 3.04 started there to give this problem. The only alteration in this function is that the function does not exist more initialize1.

The error is occurring when the function tries to make the Cast of the object for TField. TField(Fields.Objects).Value

What it can be wrong?

Please !!! Help-me !!!

Edson Martins
Brasil

Comments

  • edited 12:06PM
    It may not work if you use master-detail report with queries. Wait for FR3.05, it will out in this week.
  • edited 12:06PM
    Alex,

    The GetValue function before:

    function TfrxDBDataset.GetValue(Index: String): Variant;
    var
    i,j: Integer;
    begin
    if not FInitialized then
    Open;
    i := Fields.IndexOf(Index);
    if i <> -1 then
    Result := TField(F.Objects).value
    else
    begin
    Result := Null;
    ReportRef.Errors.Add(ReportRef.CurObject + ': ' +
    frxResources.Get('dbFldNotFound') + ' ' + UserName + '."' + Index + '"');
    end;
    end;

    Alterei a fun?§??o para:

    function TfrxDBDataset.GetValue(Index: String): Variant;
    var
    i,j: Integer;
    nField : TField;
    begin
    if not FInitialized then
    Open;
    i := Fields.IndexOf(Index);
    if i <> -1 then
    begin
    nField := FDS.FindField(Index);
    Result := NField.Value;
    end
    else
    begin
    Result := Null;
    ReportRef.Errors.Add(ReportRef.CurObject + ': ' +
    frxResources.Get('dbFldNotFound') + ' ' + UserName + '."' + Index + '"');
    end;
    end;

    We had that to modify all lines TField(F.Objects).value.

    Edson

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.