Discussion:
numerous MAVs
(too old to reply)
Graham Monk
2008-09-24 21:43:25 UTC
Permalink
I have spent the past 18 months writing an app that has been on general
release for a few months now and may have to be withdrawn due to the number
Memory Access Violation I am getting. So I am of the option that the way in
which I am coding things could be at the heart of it.

I use a lot of look ups and when I clear a row I turn off the LookUps first
then use a generic routine to clear the row to its initial values (zeros,
blanks, false, etc. depending on type) and turn the LookUps back on. This
works fine for one or more rows then eventually MAVs on the 'return'
statement of the cancelLookUps. Code to do this exists in lots of places
throughout the app and about half are OK and the rest MAV. Does anyone have
any suggestions please? I also get a log of MAVs from me drag and drop code
that moves lines about in a single row set where the same cancelLookUp and
setLookUp routines are called.

DataModule code:

function qItems_onOpen
this.rowset.setLookUps = class::rsItems_setLookUps
this.rowset.cancelLookUps = class::rsItems_cancelLookUps
this.rowset.setLookUps()
return

function rsItems_setLookUps
this.fields['Item_File_No'].lookupSQL = [select File_No, Short_Name
from File_List]
return

function rsItems_cancelLookUps
this.fields['Item_File_No'].lookupSQL = null
return << MAV here!

Regards,
Graham
Greg Hill
2008-09-24 22:44:23 UTC
Permalink
Post by Graham Monk
I have spent the past 18 months writing an app that has been on general
release for a few months now and may have to be withdrawn due to the number
Memory Access Violation I am getting. So I am of the option that the way in
which I am coding things could be at the heart of it.
I use a lot of look ups and when I clear a row I turn off the LookUps first
then use a generic routine to clear the row to its initial values (zeros,
blanks, false, etc. depending on type) and turn the LookUps back on. This
works fine for one or more rows then eventually MAVs on the 'return'
statement of the cancelLookUps. Code to do this exists in lots of places
throughout the app and about half are OK and the rest MAV. Does anyone have
any suggestions please? I also get a log of MAVs from me drag and drop code
that moves lines about in a single row set where the same cancelLookUp and
setLookUp routines are called.
function qItems_onOpen
this.rowset.setLookUps = class::rsItems_setLookUps
this.rowset.cancelLookUps = class::rsItems_cancelLookUps
this.rowset.setLookUps()
return
function rsItems_setLookUps
this.fields['Item_File_No'].lookupSQL = [select File_No, Short_Name
from File_List]
return
function rsItems_cancelLookUps
this.fields['Item_File_No'].lookupSQL = null
return << MAV here!
The fact that it works here in there might be enough to say good bye to that
method.
I know I am being a little simplistic to say that there is more than one way
to skin a cat.
I have ran into similar stuff where I had to find another way to do the same
thing. Maybe its a lot of code to change but the app can and will be
reliable, many of us have rather complex apps running without MAV's.
I have cases where I manage my own lookups, when you think about it, it is
not really much to do.
I have done it a couple different ways:

I don't datalink the field, then, when the user tabs into the field I popup
a little lookup form with a seeker on it. They pick the value they want and
I put the value they selected in the un-datalinked field, while stuffing the
key value in the rowset.fields["whatever"].value.

Another very simple way to do this is to make an array of the lookup content
"with" a preceding key value, the key value is left justified and the field
it feeds is only big enough to receive the key value<g> It looks like this:
00124 - San Diego
00125 - Los Angeles
ect...

The user picks the desired item and it can only store the width of the
actual datalinked field. (not a silver bullet solution for all applications
but works very well for small list and has no over head.

Are you using the COMBOBOX control for these?


Greg Hill
Frank J. Polan
2008-09-24 23:31:18 UTC
Permalink
Graham

I also have a problem with random occurring MAVs. The only constant is
that there is always printing involved but the MAVs don't always
indicate this in the error log. So don't be too sure it's the lookups.

I'm checking / rewriting the Reports but in the meantime I make sure
everything is saved before calling a print routine

Frank Polan


On Thu, 25 Sep 2008 09:43:25 +1200, "Graham Monk"
Post by Graham Monk
I have spent the past 18 months writing an app that has been on general
release for a few months now and may have to be withdrawn due to the number
Memory Access Violation I am getting. So I am of the option that the way in
which I am coding things could be at the heart of it.
I use a lot of look ups and when I clear a row I turn off the LookUps first
then use a generic routine to clear the row to its initial values (zeros,
blanks, false, etc. depending on type) and turn the LookUps back on. This
works fine for one or more rows then eventually MAVs on the 'return'
statement of the cancelLookUps. Code to do this exists in lots of places
throughout the app and about half are OK and the rest MAV. Does anyone have
any suggestions please? I also get a log of MAVs from me drag and drop code
that moves lines about in a single row set where the same cancelLookUp and
setLookUp routines are called.
function qItems_onOpen
this.rowset.setLookUps = class::rsItems_setLookUps
this.rowset.cancelLookUps = class::rsItems_cancelLookUps
this.rowset.setLookUps()
return
function rsItems_setLookUps
this.fields['Item_File_No'].lookupSQL = [select File_No, Short_Name
from File_List]
return
function rsItems_cancelLookUps
this.fields['Item_File_No'].lookupSQL = null
return << MAV here!
Regards,
Graham
Lysander
2008-09-25 08:53:49 UTC
Permalink
Post by Frank J. Polan
I also have a problem with random occurring MAVs. The only constant is
that there is always printing involved but the MAVs don't always
indicate this in the error log. So don't be too sure it's the lookups.
Frank,
any change in the printer driver?

I only recently had to fight (and did not win the battle so far) with
problems caused only by exchanging a printer.

I replaced an old Kyocera FS 1010 by a new FS 1030. I have updated
drivers on all machines for all printers.

The same program (printing of cheques) works fine on all printers we
have in the company; but using it with the FS1030 (same machine same
user, same program...) instead of the FS1010 will make the program crash
with a MAV roughly AFTER (!) every 3rd or 4th job printed.

So you are probably right that it is nothing in the code.

regards,
André
Frank J. Polan
2008-09-25 18:13:03 UTC
Permalink
Andre

Their IT "cleaned up" the PCs, checked the printer drivers, etc. I've
modified the code a little. The users are supposed to reboot before
running the problem forms ( but I don't know if this is being followed
consistenly)The MAVS are still there but much less frequent.

Still working on it

Frank Polan
Post by Lysander
Post by Frank J. Polan
I also have a problem with random occurring MAVs. The only constant is
that there is always printing involved but the MAVs don't always
indicate this in the error log. So don't be too sure it's the lookups.
Frank,
any change in the printer driver?
I only recently had to fight (and did not win the battle so far) with
problems caused only by exchanging a printer.
I replaced an old Kyocera FS 1010 by a new FS 1030. I have updated
drivers on all machines for all printers.
The same program (printing of cheques) works fine on all printers we
have in the company; but using it with the FS1030 (same machine same
user, same program...) instead of the FS1010 will make the program crash
with a MAV roughly AFTER (!) every 3rd or 4th job printed.
So you are probably right that it is nothing in the code.
regards,
André
Frank J. Polan
2008-09-26 01:22:59 UTC
Permalink
Rich,

In my opinions - not backed by any scientific evidence <g> removing
the datamodrefs seems to have helped somewhat. The problem is that
they're so random, and the users have so many other things going on
at the same time, it's hard to be sure.

Frank Polan
FWIW, I've had an MAV problem with a newly-introduced, small DEO application (local Win2000 network).
I'm still in beta, but it does happen most consistently with the user printing the most (also to a Kyocera network printer), and with using Vic's printer class for some reports. Many of the forms were also using shared dataModRefs, which I've been trying to eliminate (leftover code...).
My impression so far is that both measures have helped - as I've reduced the shared datamodRef, there's been a slight decrease in the MAV reports.... but I think (hope) that replacing Vic's class with new reports will do more....
Rich Assaf
Post by Lysander
Post by Frank J. Polan
I also have a problem with random occurring MAVs. The only constant is
that there is always printing involved but the MAVs don't always
indicate this in the error log. So don't be too sure it's the lookups.
Frank,
any change in the printer driver?
I only recently had to fight (and did not win the battle so far) with
problems caused only by exchanging a printer.
I replaced an old Kyocera FS 1010 by a new FS 1030. I have updated
drivers on all machines for all printers.
The same program (printing of cheques) works fine on all printers we
have in the company; but using it with the FS1030 (same machine same
user, same program...) instead of the FS1010 will make the program crash
with a MAV roughly AFTER (!) every 3rd or 4th job printed.
So you are probably right that it is nothing in the code.
regards,
André
Rich
2008-09-26 01:12:20 UTC
Permalink
FWIW, I've had an MAV problem with a newly-introduced, small DEO application (local Win2000 network).

I'm still in beta, but it does happen most consistently with the user printing the most (also to a Kyocera network printer), and with using Vic's printer class for some reports. Many of the forms were also using shared dataModRefs, which I've been trying to eliminate (leftover code...).

My impression so far is that both measures have helped - as I've reduced the shared datamodRef, there's been a slight decrease in the MAV reports.... but I think (hope) that replacing Vic's class with new reports will do more....

Rich Assaf
Post by Lysander
Post by Frank J. Polan
I also have a problem with random occurring MAVs. The only constant is
that there is always printing involved but the MAVs don't always
indicate this in the error log. So don't be too sure it's the lookups.
Frank,
any change in the printer driver?
I only recently had to fight (and did not win the battle so far) with
problems caused only by exchanging a printer.
I replaced an old Kyocera FS 1010 by a new FS 1030. I have updated
drivers on all machines for all printers.
The same program (printing of cheques) works fine on all printers we
have in the company; but using it with the FS1030 (same machine same
user, same program...) instead of the FS1010 will make the program crash
with a MAV roughly AFTER (!) every 3rd or 4th job printed.
So you are probably right that it is nothing in the code.
regards,
André
Lysander
2008-09-26 07:56:18 UTC
Permalink
My impression so far is that both measures have helped - as I've reduced the shared datamodRef, there's been a slight decrease in the MAV reports.... but I think (hope) that replacing Vic's class with new reports will do more....
I have never used datamo(r)dRefs and also never used Vic's Printer
Class. I am with Crystal Reports on that matter; have used various
versions without even having problems (CR 7, CR9, CR9.2, CR10).

I only have problems with one printer. Unfortunately I cannot run
another printer driver, because that one specifically was bought to
support 2 additional paper trays. But the MAVs (_AFTER_ printing!) occur
also when not using any of the advanced tray functions.
Jan Hoelterling
2008-09-26 12:56:14 UTC
Permalink
Hi Andre,

have you tested this with FinePrint (www.fineprint.com)? This is a printer
driver that sits "in between" the application and the "real" printer driver.
It has helped me greatly in identifying and reducing print problems.

Jan
Lysander
2008-10-17 10:19:08 UTC
Permalink
Post by Jan Hoelterling
Hi Andre,
have you tested this with FinePrint (www.fineprint.com)? This is a printer
driver that sits "in between" the application and the "real" printer driver.
It has helped me greatly in identifying and reducing print problems.
Thanks, Jan.
No I did not have this idea so far, but I would very much like to reduce
those problems because they are unfortunately not just somewhere but in
a very critical place of our company - when printing cheques.

How could this software be of help?
If you don't have time to explain now, we should discuss it during the
conference in november.
Rich Assaf
2008-10-19 19:53:46 UTC
Permalink
Post by Lysander
Post by Jan Hoelterling
Hi Andre,
have you tested this with FinePrint (www.fineprint.com)? This is a printer
driver that sits "in between" the application and the "real" printer driver.
It has helped me greatly in identifying and reducing print problems.
Thanks, Jan.
No I did not have this idea so far, but I would very much like to reduce
those problems because they are unfortunately not just somewhere but in
a very critical place of our company - when printing cheques.
How could this software be of help?
If you don't have time to explain now, we should discuss it during the
conference in november.
I successfully eliminated my MAV issue by completely purging Vic's
Printer Class from my app.... In my case, the errors were occurring
after a user ran any report that used Vic's class.

I can still reproduce the error in development mode, if I have the
database active when I start the program, than I immediately get the
error. So there's probably something else I'm not doing right with BDE
and alias management, but I'm just happy to have solved 95% of the
problem.

Rich

Jan Hoelterling
2008-09-24 23:56:42 UTC
Permalink
Hi Graham,

I am not sure if I can be of much help, but I have several applications with
many hundreds of users out there, and they are very very stable.

I use lookups extensively, as well, but without any of the "overhead" you're
applying to set and cancel them. I don't seem to have any problems using it
that way. Have you tried commenting out the "cleanup" code and see if that
changes things?

Jan
Graham Monk
2008-09-25 00:15:22 UTC
Permalink
Hi guys,

Thanks for your input.

Jan, I have just commented out the two "...lookupSQL = ..." statements and
the problem goes away! So it looks like repeated lookupSQL operations may
have something to do with it.

I am looking at Greg's idea, but this rowset is in a rowSelect = true grid
of fixed length (20 records) where you can drag rows from other grids, move
rows up and down and clear rows all with the mouse each of which requires
the lookupSQL to be cancelled and re-established. So I am not sure how to
get round it, because the lookupSQL converts a column of numbers to text.

Regards,
Graham
Post by Jan Hoelterling
Hi Graham,
I am not sure if I can be of much help, but I have several applications with
many hundreds of users out there, and they are very very stable.
I use lookups extensively, as well, but without any of the "overhead" you're
applying to set and cancel them. I don't seem to have any problems using it
that way. Have you tried commenting out the "cleanup" code and see if that
changes things?
Jan
Graham Monk
2008-09-25 04:11:41 UTC
Permalink
Hi Greg,

I write apps that read and write programming data as well as read and
process sales data for Casio cash registers as used in shops, bars, cafes,
etc. This means that my data structures are to some degree forced upon me by
Casio and this leads to problems that would not normally exist if you
controlled your own data structures. The files that are passed to and from
the tills are text/csv/hex. The biggest challenge is representing till key
maps or screen maps on a PC and then using drag and drop to change
function/shape/colour/bitmap/etc.

Regards,
Graham
Post by Jan Hoelterling
Hi Graham,
I am not sure if I can be of much help, but I have several applications
with many hundreds of users out there, and they are very very stable.
I am always impressed to hear of that kind of success.
What type of market is your app or apps written for?
Greg Hill
Greg Hill
2008-09-25 03:17:27 UTC
Permalink
Post by Jan Hoelterling
Hi Graham,
I am not sure if I can be of much help, but I have several applications
with many hundreds of users out there, and they are very very stable.
I am always impressed to hear of that kind of success.

What type of market is your app or apps written for?

Greg Hill
Graham Monk
2008-09-25 01:25:26 UTC
Permalink
Hi Andrew,

This is a single user PC (non Network) based app and do not know if they
create _QSQL*.* files.

So if you do not use lookUps then how would you convert a number of codes in
a table (myCode, myDescription) to present themselves as myDescription on a
grid column for a rowset that contains myCode?

Regards,
Graham
Post by Jan Hoelterling
Graham,
It has been a long time since I used SQL lookups so I do not remember much
about them. Can they generate temporary files like _QSQL*.*?
Post by Jan Hoelterling
Do the MAVs occur on a single user system or are they occurring on a
multi-user system?
Post by Jan Hoelterling
regards, andrew
Post by Graham Monk
I have spent the past 18 months writing an app that has been on general
release for a few months now and may have to be withdrawn due to the number
Memory Access Violation I am getting. So I am of the option that the way in
which I am coding things could be at the heart of it.
I use a lot of look ups and when I clear a row I turn off the LookUps first
then use a generic routine to clear the row to its initial values (zeros,
blanks, false, etc. depending on type) and turn the LookUps back on. This
works fine for one or more rows then eventually MAVs on the 'return'
statement of the cancelLookUps. Code to do this exists in lots of places
throughout the app and about half are OK and the rest MAV. Does anyone have
any suggestions please? I also get a log of MAVs from me drag and drop code
that moves lines about in a single row set where the same cancelLookUp and
setLookUp routines are called.
function qItems_onOpen
this.rowset.setLookUps = class::rsItems_setLookUps
this.rowset.cancelLookUps = class::rsItems_cancelLookUps
this.rowset.setLookUps()
return
function rsItems_setLookUps
this.fields['Item_File_No'].lookupSQL = [select File_No, Short_Name
from File_List]
return
function rsItems_cancelLookUps
this.fields['Item_File_No'].lookupSQL = null
return << MAV here!
Regards,
Graham
Jan Hoelterling
2008-09-25 01:42:35 UTC
Permalink
Post by Graham Monk
So if you do not use lookUps then how would you convert a number of codes in
a table (myCode, myDescription) to present themselves as myDescription on a
grid column for a rowset that contains myCode?
MasterRowset / MasterFields comes to mind - a grid can combine data from
many queries.

Jan
Graham Monk
2008-09-25 01:47:07 UTC
Permalink
Thanks, I will give it a try.

Regards,
Graham
Post by Jan Hoelterling
Post by Graham Monk
So if you do not use lookUps then how would you convert a number of
codes
Post by Jan Hoelterling
Post by Graham Monk
in
a table (myCode, myDescription) to present themselves as myDescription
on
Post by Jan Hoelterling
Post by Graham Monk
a
grid column for a rowset that contains myCode?
MasterRowset / MasterFields comes to mind - a grid can combine data from
many queries.
Jan
Graham Monk
2008-09-25 02:07:00 UTC
Permalink
And what do you know, one less MAV, at least I think so. I will put it out
to the beta sites for checking. Thanks guys for your input. I will get back
to you when I isolated the next MAV :-)

Regards,
Graham
Post by Jan Hoelterling
Post by Graham Monk
So if you do not use lookUps then how would you convert a number of
codes
Post by Jan Hoelterling
Post by Graham Monk
in
a table (myCode, myDescription) to present themselves as myDescription
on
Post by Jan Hoelterling
Post by Graham Monk
a
grid column for a rowset that contains myCode?
MasterRowset / MasterFields comes to mind - a grid can combine data from
many queries.
Jan
Jan Hoelterling
2008-09-25 02:09:53 UTC
Permalink
Glad to help. I can only imagine your frustration...

Jan
Andrew Shimmin
2008-09-25 02:47:59 UTC
Permalink
Graham,

The temporary _QSQL*.* problem will only surface on a multi-user system so that is a dead-end for you.
Post by Graham Monk
So if you do not use lookUps then how would you convert a number of codes in
a table (myCode, myDescription) to present themselves as myDescription on a
grid column for a rowset that contains myCode?
Use something unnecessarily complex which I would not do or recommend. The best answer is to find the source of the MAVs and that can be a real PITA. One took me over a year to find.

Sorry I could not help.

regards, andrew
Post by Graham Monk
Hi Andrew,
This is a single user PC (non Network) based app and do not know if they
create _QSQL*.* files.
So if you do not use lookUps then how would you convert a number of codes in
a table (myCode, myDescription) to present themselves as myDescription on a
grid column for a rowset that contains myCode?
Regards,
Graham
Post by Jan Hoelterling
Graham,
It has been a long time since I used SQL lookups so I do not remember much
about them. Can they generate temporary files like _QSQL*.*?
Post by Jan Hoelterling
Do the MAVs occur on a single user system or are they occurring on a
multi-user system?
Post by Jan Hoelterling
regards, andrew
Post by Graham Monk
I have spent the past 18 months writing an app that has been on general
release for a few months now and may have to be withdrawn due to the
number
Post by Jan Hoelterling
Post by Graham Monk
Memory Access Violation I am getting. So I am of the option that the way
in
Post by Jan Hoelterling
Post by Graham Monk
which I am coding things could be at the heart of it.
I use a lot of look ups and when I clear a row I turn off the LookUps
first
Post by Jan Hoelterling
Post by Graham Monk
then use a generic routine to clear the row to its initial values
(zeros,
Post by Jan Hoelterling
Post by Graham Monk
blanks, false, etc. depending on type) and turn the LookUps back on.
This
Post by Jan Hoelterling
Post by Graham Monk
works fine for one or more rows then eventually MAVs on the 'return'
statement of the cancelLookUps. Code to do this exists in lots of places
throughout the app and about half are OK and the rest MAV. Does anyone
have
Post by Jan Hoelterling
Post by Graham Monk
any suggestions please? I also get a log of MAVs from me drag and drop
code
Post by Jan Hoelterling
Post by Graham Monk
that moves lines about in a single row set where the same cancelLookUp
and
Post by Jan Hoelterling
Post by Graham Monk
setLookUp routines are called.
function qItems_onOpen
this.rowset.setLookUps = class::rsItems_setLookUps
this.rowset.cancelLookUps = class::rsItems_cancelLookUps
this.rowset.setLookUps()
return
function rsItems_setLookUps
this.fields['Item_File_No'].lookupSQL = [select File_No,
Short_Name
Post by Jan Hoelterling
Post by Graham Monk
from File_List]
return
function rsItems_cancelLookUps
this.fields['Item_File_No'].lookupSQL = null
return << MAV here!
Regards,
Graham
Lysander
2008-09-25 08:50:13 UTC
Permalink
Post by Graham Monk
So if you do not use lookUps then how would you convert a number of codes in
a table (myCode, myDescription) to present themselves as myDescription on a
grid column for a rowset that contains myCode?
Never used any lookup in my dBase-applications and at their peak they
were serving 50 clients at once accessing a total of more than 500 DBFs,
some of them really huge and complex.

dbase language is perfectly capable of using a subset of SQL syntax
called "Local SQL". While it is "only" a subset, the JOIN feature for
linking IDs to their respective lookup values is working great.
Andrew Shimmin
2008-09-25 00:55:10 UTC
Permalink
Graham,

It has been a long time since I used SQL lookups so I do not remember much about them. Can they generate temporary files like _QSQL*.*?

Do the MAVs occur on a single user system or are they occurring on a multi-user system?

regards, andrew
Post by Graham Monk
I have spent the past 18 months writing an app that has been on general
release for a few months now and may have to be withdrawn due to the number
Memory Access Violation I am getting. So I am of the option that the way in
which I am coding things could be at the heart of it.
I use a lot of look ups and when I clear a row I turn off the LookUps first
then use a generic routine to clear the row to its initial values (zeros,
blanks, false, etc. depending on type) and turn the LookUps back on. This
works fine for one or more rows then eventually MAVs on the 'return'
statement of the cancelLookUps. Code to do this exists in lots of places
throughout the app and about half are OK and the rest MAV. Does anyone have
any suggestions please? I also get a log of MAVs from me drag and drop code
that moves lines about in a single row set where the same cancelLookUp and
setLookUp routines are called.
function qItems_onOpen
this.rowset.setLookUps = class::rsItems_setLookUps
this.rowset.cancelLookUps = class::rsItems_cancelLookUps
this.rowset.setLookUps()
return
function rsItems_setLookUps
this.fields['Item_File_No'].lookupSQL = [select File_No, Short_Name
from File_List]
return
function rsItems_cancelLookUps
this.fields['Item_File_No'].lookupSQL = null
return << MAV here!
Regards,
Graham
Graham Monk
2008-09-25 08:32:52 UTC
Permalink
Hi Bruce,

Thanks for your ideas. I did just what you suggested a while back along with
other juggles of the code and it made no difference. In this case Jan's
suggestion of using MasterRowset / MasterFields has got me round the problem
in about 5 places already today.

WRT your datamodule/database MAV you might like to take a look at my report
MAV "MAV and AccocArry" dated 1st July 08 in Bug-reports and the code is in
Binaries. It took hours to reduce it to what I submitted and just commenting
out an empty function makes it go away, but it is in the area of closing a
datamodule/database where the problem lies.

Regards,
Graham
Post by Graham Monk
I use a lot of look ups and when I clear a row I turn off the LookUps first
then use a generic routine to clear the row to its initial values (zeros,
blanks, false, etc. depending on type) and turn the LookUps back on. This
works fine for one or more rows then eventually MAVs on the 'return'
statement of the cancelLookUps.
Looking at where the code fails, I suspect that the issue is with what
happens in the calling routine after the rsItems_cancelLookUps routine
has returned. Is it called from a codeblock? You don't tell us how
it is called, AFAICS.
I have a problem of MAVs and datamodules too, and I have located one
cause as closing a database attached to a datamodule when there are open
queries still attached to that datamodule. As ever, it's not been
possible to reduce it - yet - to a turnkey. It seems to happen when
there is a number of instances of the datamodule, not just one or two,
but they may be in various states of currency so I can't yet say what
the significant symptom is.
Also, consider this. When a lookupsql is set, a query is created on
the database. When you null the lookupsql property you are letting
loose the query. If you reinstate the lookupsql you create another
query. So if there is anything wrong with PLUS's process of releasing
orphaned queries you will get a build-up of queries. If the database
then closes, or twitches, or something, it may be that the queries close
badly. I dunno, but observation suggests something on these lines.
I would also suggest that if you have any calculated fields on the main
query which refer to the lookuprowset, you null the beforgetvalue before
cancelling the lookupsql.
function rsItems_cancelLookUps
this.fields['Item_File_No'].lookupSQL = null
x = 1
x = 1
return << MAV here!
Then see where the MAV occurs.
Bruce Beacham
Bruce Beacham
2008-09-25 13:07:04 UTC
Permalink
Post by Graham Monk
Thanks for your ideas. I did just what you suggested a while back along with
other juggles of the code and it made no difference. In this case Jan's
suggestion of using MasterRowset / MasterFields has got me round the problem
in about 5 places already today.
Good to hear that.
Post by Graham Monk
WRT your datamodule/database MAV you might like to take a look at my report
MAV "MAV and AccocArry" dated 1st July 08 in Bug-reports and the code is in
Binaries. It took hours to reduce it to what I submitted and just commenting
out an empty function makes it go away, but it is in the area of closing a
datamodule/database where the problem lies.
Yes. I must say that I wouldn't create findable references to rowsets:
I'd always point at the query, because the query is the top
free-standing object.

As you say, it's odd when altering the source file but not the code
makes a bug go away!!


Bruce
Bruce Beacham
2008-09-25 08:14:38 UTC
Permalink
Post by Graham Monk
I use a lot of look ups and when I clear a row I turn off the LookUps first
then use a generic routine to clear the row to its initial values (zeros,
blanks, false, etc. depending on type) and turn the LookUps back on. This
works fine for one or more rows then eventually MAVs on the 'return'
statement of the cancelLookUps.
Looking at where the code fails, I suspect that the issue is with what
happens in the calling routine after the rsItems_cancelLookUps routine
has returned. Is it called from a codeblock? You don't tell us how
it is called, AFAICS.

You can test this by adding some dummy lines thus:


I have a problem of MAVs and datamodules too, and I have located one
cause as closing a database attached to a datamodule when there are open
queries still attached to that datamodule. As ever, it's not been
possible to reduce it - yet - to a turnkey. It seems to happen when
there is a number of instances of the datamodule, not just one or two,
but they may be in various states of currency so I can't yet say what
the significant symptom is.

Also, consider this. When a lookupsql is set, a query is created on
the database. When you null the lookupsql property you are letting
loose the query. If you reinstate the lookupsql you create another
query. So if there is anything wrong with PLUS's process of releasing
orphaned queries you will get a build-up of queries. If the database
then closes, or twitches, or something, it may be that the queries close
badly. I dunno, but observation suggests something on these lines.

I would also suggest that if you have any calculated fields on the main
query which refer to the lookuprowset, you null the beforgetvalue before
cancelling the lookupsql.

function rsItems_cancelLookUps
this.fields['Item_File_No'].lookupSQL = null
x = 1
x = 1
return << MAV here!

Then see where the MAV occurs.


Bruce Beacham
Loading...