AV in report with manual SQL and parameter
RB 11.05 Enterprise, Delphi 2009, DADE: dakbmMW
Hello,
in a report, I use a datapipeline with manual SQL and one parameter.
When loading this report or select tab "Preview" and then "Design", an AV
occurs in
ppParameter.pas, function TppParameterList.GetParameterForName, Line 1228:
while (Result = nil) and (liIndex < ChildCount) do <- ChildCount
returns nil!!!
Any ideas?
Lars Hirthe
Hello,
in a report, I use a datapipeline with manual SQL and one parameter.
When loading this report or select tab "Preview" and then "Design", an AV
occurs in
ppParameter.pas, function TppParameterList.GetParameterForName, Line 1228:
while (Result = nil) and (liIndex < ChildCount) do <- ChildCount
returns nil!!!
Any ideas?
Lars Hirthe
This discussion has been closed.
Comments
We are going to need more information about the nature of your SQL statement
and report design to track something like this down. Please give more
detail about what you are building or give the steps I can take using one of
our demos to recreate the issue you are seeing.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I can reproduce this error with a blank report.
In this report, I create a parameter and a datapipeline with manual sql,
something like that:
SELECT * FROM mytable WHERE id=:myparam
The error only occurs, when I use manual SQL AND a parameter.
Perhaps, the problem is the dakbmMW?!
Lars Hirthe
some more info.
The error does not occur with the demo files using daDBBDE.
So the problem is the dakbmmw.
I know, this unit is not from DM, but is it possible to give me some advice,
where
do I have to search.
The exception occurs in this method:
function TppRelative.GetChildCount: Integer;
begin
Result := FChildren.Count; <--- EXCEPTION !!!
end;
Here is (a part of) the exception log:
Exception:
-----------------------------------------------------------------------------------------------------------------------
2.5 Type : EAccessViolation
2.6 Message : Zugriffsverletzung bei Adresse 005C668C in Modul
'ReportBuilder.exe'. Lesen von Adresse 00000088.
Call Stack Information:
-------------------------------------------------------------------------------------------------------------------------------------
|Address |Module |Unit |Class
|Procedure/Method |Line |
-------------------------------------------------------------------------------------------------------------------------------------
|Running Thread: ID=3904; Priority=0; Class=; [Main]
|
|-----------------------------------------------------------------------------------------------------------------------------------|
|005C668C|ReportBuilder.exe|ppRelatv.pas |TppRelative
|GetChildCount |504[1] |
|005E9DB6|ReportBuilder.exe|ppParameter.pas
|TppParameterList |GetParameterForName |1228[5] |
|005E9BBC|ReportBuilder.exe|ppParameter.pas
|TppParameterList |GetParameterForName |1223[0] |
|005E9E51|ReportBuilder.exe|ppParameter.pas
|TppParameterList |InList |1260[1] |
|005E9E2C|ReportBuilder.exe|ppParameter.pas
|TppParameterList |InList |1259[0] |
|008113DA|ReportBuilder.exe|daSQLText.pas |TdaSQLText
|GetCommandText |285[6] |
|0080BC68|ReportBuilder.exe|daSQL.pas |TdaSQL
|GetSQLCommandText |8376[3] |
|0080BC48|ReportBuilder.exe|daSQL.pas |TdaSQL
|GetSQLCommandText |8373[0] |
|00805827|ReportBuilder.exe|daSQL.pas |TdaSQL
|GetMagicSQLText |3615[5] |
|00805810|ReportBuilder.exe|daSQL.pas |TdaSQL
|GetMagicSQLText |3610[0] |
|0088DECA|ReportBuilder.exe|dakbmMW.pas
|TdakbmMWQueryDataView |UpdateQueryObject |556[15] |
|0088DDB4|ReportBuilder.exe|dakbmMW.pas
|TdakbmMWQueryDataView |UpdateQueryObject |541[0] |
|0088DD28|ReportBuilder.exe|dakbmMW.pas
|TdakbmMWQueryDataView |Loaded |504[2] |
|77680226|USER32.dll | |
|DispatchMessageW | |
|7768021C|USER32.dll | |
|DispatchMessageW | |
|008FB4D2|ReportBuilder.exe|DataModuleReports.pas |TdmReports
|DataModuleCreate |108[5] |
|7684AE35|ole32.dll | |
|CoInitializeEx | |
|0090204F|ReportBuilder.exe|ReportBuilder.dpr |
| |12[2] |
|7646D0E7|kernel32.dll | |
|BaseThreadInitThunk | |
|-----------------------------------------------------------------------------------------------------------------------------------|
Assembler Information:
----------------------------------------------------------
; ppRelatv.TppRelative.GetChildCount (Line=504 - Offset=1)
; --------------------------------------------------------
005C668C mov eax, [eax+$0088] ; <-- EXCEPTION
005C6692 mov eax, [eax+$08]
Lars Hirthe
This still may be an issue with the parameter logic. Try setting your
library path to \RBuilder\Source\ and trace into
TppParameter.GetParameterForName routine and see why the AV might be
occuring.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
occuring. Now we need to try to track down why the ChildCount is nil for
your application and why it functions correctly with the demos.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
my newest investigations.
The AV occurs, because TdaSQL.GetReportParameters returns nil
(DataView.Report is nil!!)
The call stack:
ppParameter.TppParameterList.GetParameterForName('Test') <- Exception !!!
ppParameter.TppParameterList.InList('Test')
daSQLText.TdaSQLText.GetCommandText(nil) <-
aParameters=nil
daSQL.TdaSQL.GetSQLCommandText
daSQL.TdaSQL.GetMagicSQLText
dakbmMW.TdakbmMWQueryDataView.UpdateQueryObject
dakbmMW.TdakbmMWQueryDataView.Loaded
I assume, that the unit dakbmMW is the problem.
Lars Hirthe