Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TQuery/QReport occasional missing record?

Status
Not open for further replies.

RobNorthcott

Programmer
Feb 11, 2002
30
GB
I've got a freaky problem that I can't explain - just checking to see if it's a known issue with BDE/TQuery/QReport before I waste too much time...

Our app is written in Delphi 5 using the BDE and Paradox. It prints invoices using a TQuery to get the required lines of invoice(s) then prints them using QReport. Very occasionally it seems to miss one or more lines from the invoice. Running the print operation again always works, so it's not a data issue. All I can think of is that the query sometimes fails to return a full result set, or the QReport is skipping a line of the detail file. I've never managed to replicate this to test it, but a couple of customers have shown me invoices that have missing lines, so I know it is happening. It is VERY intermittant - one customer who reports this problem is a large wholesaler doing thousands of invoices a month and they reckon it only happens once a month.

Any ideas? Is there a known problem with intermittant failure of TQuery, QReport, BDE? It's almost as weird as that 4GB disk space bug...

BTW, it doesn't seem to be OS-linked - people have reported the problem on Win98 and XP, and possibly 2000 but I can't be sure of that.

Rob
 
We use Dataflex/Powerflex as our accounts system database engine, and a 3rd party ODBC driver called CONNX to get into it from Excel, Delphi, etc.

I had the exact same issue one time, although instead of missing records, some records, maybe 2-6 out of 10,000 would be blank. Refresh, and all ok, except maybe a couple of different blank records.

Issue was traced to the CONNX ODBC driver where they had a thread race condition between their reader and writer threads. Got them to fix it, and problem solved.

If your problem was an index issue, you'd get the same results every time. If the results are different, then it must be the software between you and the data. If possible, try and get to your data via another pathway that eliminates one of the layers, eg. Delphi5, BDE or Paradox driver.
 
Sorry for the delay - only just noticed your reply (seems the email notification isn't working).

Since my first post we've added some code to run through the query before it's passed to the report and check that all the records for each invoice are there. This finds no missing records, but the report still has the same problem, which would suggest the problem is in QReport (if it was a random BDE/Paradox failure I would expect the check to fail occasionally in the same way the report does). Our next plan is to temporarily produce the invoice output in code, straight to the TPrinter canvas - bit of a pain but at least that'll eliminate QReport as the problem. I'll post back here when we have any more news. If we give it to our busiest customer to test they'll get the problem again within a week or so if it still happens.

Rob
 
I had a similar problem with QReports. To resolve I did a SetRange before the call, count the recs, call the report, counting them each in the BeforePrint method, then compare the two results before calling CancelRange. If they don't match, raise an exception. That way at least you know when it occurs.

I think there's memory leak in QRPrinter when printing images on a report. Does anyone have a solution for that one?

Roo
Delphi Rules!
 
Thanks for that - at least it's not just me! I've coded the offending report manually now, straight to the TPrinter.Canvas using TextOut and so far it hasn't given any more problems. Need to give it a bit longer before we can be sure the problem is gone, but it certainly points the finger at QReport.

Rob
 
Do you have the latest version of QuickReports? Back in Delphi 7 QReport was free, but now you have to pay for it. But once you pay for it, maintenance is free. You get all bug fixes and future versions for free, too. It's not bad! And the tech support is, in my opinion, really good. We use QuickReports all the time. Their latest version is 4.07 released April of this year. Go to for more information.

GIS Programmer
City of Orem, UT
 
I'm not using the latest version - I'm using QuickReport 3 with Delphi 5. I did try to port the app to Delphi 7 which has a different release of QR, but we've used a few 3rd party components that don't work so it's not going to be a quick task.

I'm sure the people at qusoft are fantastic - I was just asking if anybody else had had a similar problem - I was starting to suspect a BDE/Paradox problem, which would have been far more of a pain for us.

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top