AV: when selecting a field

I installed OQB on delphi6. I compiled the bde demo and run it.
When I try to select a field from a table to be include in the sql statement
I get an AV at the line below. ( see ***** AV: HERE *******)

procedure TOQBLbx.ClickCheck;
var
iCol: Integer;
begin
inherited;
if FLoading then
Exit;

if Checked[ItemIndex] then
begin
TOQBForm(GetParentForm(Self)).QBGrid.Insert( // ***** AV: HERE *******
TOQBForm(GetParentForm(Self)).QBGrid.ColCount,
Items[ItemIndex], TOQBTable(Parent).FTableName);
end



Comments

  • SamuraySamuray Administrator
    edited 10:12PM
    Thank you for bug report.
    This error present constantly?
  • edited 10:12PM
    Yes, all the time I try to add a field
  • edited 10:12PM
    ;) Hi, I have found the same error with OQB in Delphi 6. The problem seems to be that the parent of the stringGrid (TOQBGrid) is being set as nil. For some reason the parent property of (tabColumn - TOQBgrids parent) is being set as nil in delphi 6. The same code recompiles and runs ok in delphi 5.

    anyone got any ideas ?

    Thankx in advance.
  • edited November 2003
    martinB wrote:
    TOQBgrids parent) is being set as nil in delphi 6. The same code recompiles and runs ok in delphi 5.
    Just want to confirm the I'm having the same problem in D6. D7 is OK.

    Anyone working on a fix?

    I notice that after dropping in my much hacked Qbuilder.pas, which dates back to the days of Delphi 4, no such problem.

    I've just placed an update at http://groups.yahoo.com/group/fastreport/f...51_MSAccess.zip

    Be warned that this thing is very muched geared towards MS-Access, ie unsual table and field name delimiters, although you can easily change that be searching for

    FmsAccess := True;
    and changing it to

    FmsAccess := False;


    TIA
  • edited 10:12PM
    A very simple fix is add this line:

    QBGrid.Parent := TabColumns;

    in the event OnCreate of OQBForm

    The problem is that TOQBForm.CreateParams if called before TabColumns is loaded. A professional fix is create a procedure Loaded in TOQBForm class which is called automatically after OQBForm is fully created. But is similar to my first fix.
  • edited 10:12PM
    rodries wrote:
    A very simple fix is add this line:

    QBGrid.Parent := TabColumns;

    in the event OnCreate of OQBForm

    The problem is that TOQBForm.CreateParams if called before TabColumns is loaded. A professional fix is create a procedure Loaded in TOQBForm class which is called automatically after OQBForm is fully created. But is similar to my first fix.
    Thanks

    huang zhi

    上海

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.