Access Violation when form closes
HELP! - I'm getting an access violation when my report form closes.
The report is trivial, just a few ppDBTexts in the detail band. All is ok
as long as I stick to integer, date or short string fields. As soon as I
try a longer string field, or a ppDBMemo on a memo field, I get the AV.
The AV does not unfortunately occur on any source line in the project.
I've tried this using DBISAM and plain Paradox TTables.
The form is dynamically created and when it closes I call Release. If I
comment the Release out I get the AV when the app exits instead. If I
comment out the ppReport.Print the AV does not occur. It seems any access
to the ppReport component or any of the ppDBText components results in the
AV.
Using 6.03 with D6. MinStack increased to 8000h.
Any ideas?
Dave Riley
Tangent Software Ltd, Reading, UK
The report is trivial, just a few ppDBTexts in the detail band. All is ok
as long as I stick to integer, date or short string fields. As soon as I
try a longer string field, or a ppDBMemo on a memo field, I get the AV.
The AV does not unfortunately occur on any source line in the project.
I've tried this using DBISAM and plain Paradox TTables.
The form is dynamically created and when it closes I call Release. If I
comment the Release out I get the AV when the app exits instead. If I
comment out the ppReport.Print the AV does not occur. It seems any access
to the ppReport component or any of the ppDBText components results in the
AV.
Using 6.03 with D6. MinStack increased to 8000h.
Any ideas?
Dave Riley
Tangent Software Ltd, Reading, UK
This discussion has been closed.
Comments
RB 6.03 or RB 7. Compare this to your project.
http://www.digital-metaphors.com/tips/DynamicReportCreation.zip
If you continue to get AV's then give us some code to look at or an example
we can run and we'll tell you what the problem is.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
For the record, I have created many reports dynamically and have not had
problems. One rule is not to free report components yourself, let the report
free them. If you continue to have issues after looking at the example Jim
posted, keep asking questions.
Ed Dressel
Team DM
It seems the dynamic creation is a red herring. I followed the
instructions in the ReportBuilder Developer's Guide, "A Quick Test Spin".
I used the BIIOLIFE table instead. With one ppDBText in the detail band on
the "Species Name" field it was OK. When I added a ppDBMemo on the "Notes"
field I got the AV when the app exited.
I got the same if I used my own table with a ppDBText on a longer String
field (200 chars).
I've now discovered that the AV only occurs if the app is run within
Delphi - so it's obviously being caught by a try..except somewhere and
ignored. There's no sign of it if the app is run outside Delphi but it's
still a nuisance during development.
Another report I have contains 4 sub-reports, all on separate pipelines &
tables (making 5 tables & pipelines in total). When this app exits I get 5
AVs one after the other.
Dave Riley
compiled and ran it - if I double click report 1 (the BIOLIFE one) it
displays OK, if I then double click report 2 I get an AV. I tried
switching between a few other reports, most were ok but switching *from*
report 1 or a few of the other ones causes an AV.
Dave Riley
Tangent Software Ltd, Reading, UK
I can't reproduce what you described, 'Demo.dpr' runs fine for me (D6, RBE7)
regards,
Chris Ueberall;
from the manufacturer. RB uses the default pritner to measure the placement
of the controls for the report output. Printer drivers are flaky at best so
getting the latest one should help. You can also try installing aother
pritner driver as your default, such as an HP LaserJet 4 or 5 driver as the
default printer to see if that helps, then we know that it is the driver
causing the problem.
You can also try downloading the latest version RB 7 and test with the demo
version to see if upgrading will solve the problem.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
it up. I would suggest (1) backing up your files if they are in the
DelphiX\RBuilder directory (don't save files there, they disappear on
upgrades, I know) and following the instructions for cleaning your
installation.
Ed Dressel
different printer (HP LaserJet) and the problem disappeared.
Thanks Jim,
Dave.
On Fri, 20 Sep 2002 09:10:55 -0500, support@digital-metaphors.com (Jim