In all honesty, Andy, I don't use ca's and don't understand how or if
they contribute to this problem. Looking at the code you refer to below, I do
see that you 'scatter ... name this additive' which is bound to create problems
imo. The 'additive' keyword will ensure that existing properties are not
overwritten, but that doesn't mean you can use all the properties (native vfp &
your ryo's) as control sources. Surely if you attempt to write to the
properties named 'class', 'baseclass', 'name' etc... some issues will arise. In
your email below you scatter name this.oData which is much better.
Also, in my experience, the 'file is read only' message is rarely
accurate. Take it to mean "oops, there's a problem," and go from there.
Another possible source of this problem is that you can never tell just when
the validity of the control souces is being checked relative to when & if the
underlying cursors and/or data objects are being (re)generated. There may be
instants when the source momentarily does not exist or is, in fact, read-only.
I always set rowsourcetypes to 0 and try to set bindcontrols to .f. before
these activities.
-Lew
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andy Davies
Sent: Friday, December 08, 2006 6:21 AM
To: [EMAIL PROTECTED]
Subject: RE: ca's with scatter name objects
Lew, Michael
first a bit of background:
I first put this up for discussion in:
http://leafe.com/archives/showMsg/331417
follow up on http://leafe.com/archives/showMsg/331423
and Kevin Cully pointed out the importance of the 'memo' keyword here:
http://leafe.com/archives/showMsg/331428
In my application data entry is spread over several pages with initial stuff
being entered on Page 1, this is then saved. On a later occasion the data is
retrieved and follow up stuff is entered on Page 2.
Tthe controls are all bound to properties of thisform.oData When an existing
record is scattered (with 'memo') all of the oData properties exist (the
un-filled ones are set to Null): if that record was created by a 'scatter memo
name this' / 'gather name this memo' sequence then all is well - but when
'memo' was missed from the original create sequence then the page controls were
inaccessible and attempting to type into them gave the 'file is read only'
message.
I have seen that message with forms bound to remote views that were
non-updateable, but these controls *should* be completely unaware of the status
of the cursors. I don't have the time to set up a test scenario to check
whether this behaviour is a general case or specific to something about my form.
To sum up my experiences so far: I have found the cursoradapter plus 'scatter
name this' object idea works well. My data design has so far managed to ensure
that fields with the same name in two or more tables (e.g. idMember) are in
fact the same thing, so it tends not to matter that they are scattered more
than once. These fields are usually foreign keys and my approach is to put an
addproperty line in the init of the ca for which they are the pk - then the ca
selectcmd is e.g. 'select * from foo where fooId = ?this.nfooId'
For me the jury is still out on whether ca's offer anything over my previous
hand-coded cursorsetprop stuff, but like Everest they're there so I thought I'd
try them. It *is* useful to be able to create a quick form by dragging the ca
(if I ever find the time I might try and modify the code that does that to work
with data objects).
P.S. I also got the Les Pinter multiline 'grid' to work - example at:
http://www.hawthorn-cottage.com/pintergrid.jpg
(some people actually don't like my filing-card tab colours, but they give me a
nice warm retro feeling so I still use 'em <bg> - but I admit the
disabledbackcolor needs stepping up a bit)
Andrew Davies MBCS CITP
- AndyD 8-)#
**********************************************************************
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed. If
you have received this email in error please notify the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
Please contact [EMAIL PROTECTED] with any queries.
**********************************************************************
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.