Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 15 of 15 total
Thread Getting an AV on closing a query v3.30
Tue, Jun 20 2006 5:06 PMPermanent Link

Jeff Cook
"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote on Tue, 20 Jun 2006 15:58:59 -0400

>It sounds like you're running into this issue:
>
>http://www.elevatesoft.com/scripts/incident.dll?action=viewrep&release=4.14&type=f&incident=1909
>
>or something similar. The workaround is to use a canned result set instead
>of a live result set.
>
Tim


With DBISAM, my general approach to problems is that DBISAM is perfect and I'm somewhat imperfect, so it is bound to be my fault. Wink

I'm not sure how your incident report relates to my problem exactly, but ...

I'm using v3.30 - until ElevateDB comes out Smile- and your incident report is for v4.14

My result set is already canned because it has JOIN's and stuff and has RequestLive = False
==================
SELECT P.StreetNumber, P.StreetName, P.Suburb, P.PropertyCode,
      IF(P.Managed THEN "Yes" ELSE "No") AS Managed,
      L.LandlordCode, L.SortKey, True AS Selected
FROM Properties P
JOIN Landlords L ON (L.LandlordCode = P.LandlordCode)
WHERE P.PropertyCode NOT IN (SELECT DISTINCT PropertyCode FROM Tenants)
ORDER BY P.StreetName, P.StreetNumber
==================

Jeff Cook



--
Jeff Cook
Aspect Systems Ltd
Phone: +64-9-424 5388
Skype: jeffcooknz
www.aspect.co.nz



Tue, Jun 20 2006 6:48 PMPermanent Link

Jeff Cook
Tim


I have confirmed that my result set is canned and changed the deletion of records from the source table to be by a TDBISAMTable rather than a query.

I find that if one or more records are deleted from the source table, then the AV occurs as soon as I close the main query.  No AV if none of the records in qryProperties have Selected = True.


Cheers

Jeff

============================================
This is the latest (useless) code:-
 if qryProperties.ResultIsLive then showmessage('live')
 else showmessage('canned');
 tblProperties.Open; // NEW
 with qryProperties do
 begin
   Screen.Cursor := crSQLWait;
   pnlButton.Enabled := False;
   try
     First;
     iCount := RecordCount;
     while not EOF do
     begin
       if qryPropertiesSelected.AsBoolean then
       begin
         if tblProperties.Locate('PropertyCode', // NEW
           qryPropertiesPropertyCode.AsVariant, []) then // NEW
           tblProperties.Delete; // NEW
         StatusMessage1('Deleting Photos');
         apmDM.DeletePhotos('', qryPropertiesPropertyCode.AsString);
       end;
       Next;
     end;
   finally
     Screen.Cursor := crDefault;
     pnlButton.Enabled := True;
   end;
 end;
 Common.LogEvent('Finish deleting unused Properties');
 ActivateQuery;


--
Jeff Cook
Aspect Systems Ltd
Phone: +64-9-424 5388
Skype: jeffcooknz
www.aspect.co.nz



Wed, Jun 21 2006 1:08 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jeff,

<< I'm not sure how your incident report relates to my problem exactly, but
....

I'm using v3.30 - until ElevateDB comes out Smile- and your incident report
is for v4.14  >>

4.x was largely based on 3.x in terms of the buffer management and change
detection, hence the similarities between the two in terms of issues like
this.

<< My result set is already canned because it has JOIN's and stuff and has
RequestLive = False >>

Sorry, I missed that.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Jun 21 2006 1:11 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jeff,

<< I have confirmed that my result set is canned and changed the deletion of
records from the source table to be by a TDBISAMTable rather than a query.

I find that if one or more records are deleted from the source table, then
the AV occurs as soon as I close the main query. No AV if none of the
records in qryProperties have Selected = True. >>

What you might want to try, although it is a royal pain in the ass, is to
use an INTO clause with the query to dump the query into a specific
temporary table, close the query, use a table to open the temporary table,
and then do the processing as needed.

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Jun 22 2006 1:14 AMPermanent Link

Jeff Cook
"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote on Wed, 21 Jun 2006 13:11:19 -0400
>
>What you might want to try, although it is a royal pain in the ass, is to
>use an INTO clause with the query to dump the query into a specific
>temporary table, close the query, use a table to open the temporary table,
>and then do the processing as needed.
>
Tim


Thanks!   I did as you suggested and !bingo!  - it all works OK.

Cheers

Jeff

P.S. Thanks also to Robert, Roy, Steve and Clive for their suggestions along the way!

--
Jeff Cook
Aspect Systems Ltd
Phone: +64-9-424 5388
Skype: jeffcooknz
www.aspect.co.nz



« Previous PagePage 2 of 2
Jump to Page:  1 2
Image