Hi there Andy
You might want to take a look at these two articles, which could help you
understand how to use CA's:
http://www.utmag.com/wconnect/wc.dll?9,7,10,2089
http://www.utmag.com/wconnect/wc.dll?9,7,10,2073
You should also read: What's new in VFP 8 by Tamar Granor and Doug Hennig
and/or What's new in VFP 9 by the same authors. Both books available at
www.hentzenwerke.com
BTW, if you build a cursor adapter in the Data environment with the builder,
you are a bit limited, since the builder is good with only one table. When
you need more than one table in your CA, then you would have to modify the
sql statement by hand and likewise with the schema.
In general, if you use the builder, the way to effectively use the CA is
this:
a) don't put a recordsource in your grid
b) call the CA from the LOAD event of your form thus:
thisform.dataenvironment.adapter.cursorfill()
The above assumes you name your CA "adapter", but you could name it anything
you like
c) after you call the CA's cursorfill method in b) do this:
(put this code in the INIT event of your form)
thisform.grid1.recordsource = "mycursor" (assuming you name the cursor
"mycursor" in the CA builder)
If you want, I can send you examples on how to use CA's with grids. Just
write to:
[EMAIL PROTECTED]
Hope this helps
Rafael Copquin
www.copquin.com.ar
Universal Thread Magazine - Translation Coordinator
Treasurer - Microsoft Users Group of Argentina (MUG)
www.mug.org.ar
----- Original Message -----
From: "Andy Davies" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 14, 2006 7:51 AM
Subject: CursorAdapter
Hi,
I've been playing with the cursoradapter again and I find a couple of
things puzzling - well OK I find most things puzzling these days <g>, but
two specific things:-
where does it live?
I put a ca on a form by dragging a sql table from the task pane then tidied
it up and made it updateable (nice and easy *once* you find where the
builder lives!)
I then saved the form and opened it in the class browser: form code is
there, the de has the usual unnecessary dimension properties and
"Datasource=null"; the grid** is there with "Recordsource = Cursoradapter1"
but no ca.
OK if I hack into the .scx file it's there but the only thing linking it to
anywhere seems to be the name. I thought ca's were part of the de container
object?
** the grid is of course empty which makes it a very flexible tool (I still
don't like 'em mind) - but this means I can't change column properties e.g.
to put in combo boxes. What I tried was putting a button on the
(development) form with "thisform.GRDMy.SaveAsClass
('newgridclass','newgrid')" which does seem to give me a useful grid/browse
object (until I change the underlying table) - what do people think: is
this a useful technique or is there a better way?
p.s. do people use batchupdate with grids? - are there any wrinkles?
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.