Help - Search - Members - Calendar
Full Version: AV: when selecting a field
Fast Reports forum > Fast Reports Products > Open Query Builder
manny2463
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



Samuray
Thank you for bug report.
This error present constantly?
manny2463
Yes, all the time I try to add a field
martinB
wink.gif 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.
finalfiler
QUOTE (martinB @ Nov 13 2003, 03:32 AM)
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
rodries
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.
erp2
QUOTE (rodries @ Aug 20 2004, 10:10 AM)
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

上海
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.