Subject RE: [IBO] Using Params - one last go
Author Dion Oliphant
If you are doing a searched update (as seems likely, from what you say
here) you are going to be better off defining a separate update object,

Gotcha!!!

Ta,
Dion.

-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: 10 January 2001 09:40
To: IBObjects@egroups.com
Subject: RE: [IBO] Using Params - one last go


At 09:23 AM 10-01-01 +0200, you wrote:
>Sorry for the time this is consuming, but I would like to understand what I
>am doing.

OK.


>[************************************************ Dion
>
> .Each node in the tree has a reference to a record it represents.
> .Nodes are not data aware.
>
> If I edit the nodes description, which might NOT BE the SAME as the
>CURRENT ACTIVE RECORD in the QUERY(Grades), I want
> the description updated in the Grades query, hence my question. How
>will the TIB_Query know which record to update if my
> SQL has no params? The SQL.Text being 'SELECT * FROM Grades' and
there
>is no EditSQL, as you told me to delete it!
>
>[ ********************************************** Dion
>

I said:

>If the tree isn't data aware, read the strings for the parameters from it.

You said:
> .Each node in the tree has a reference to a record it represents.
> .Nodes are not data aware.

So what is this reference?

Basically, all you need is to [whatever you were doing] to get the values
you want into the update parameters.

Only you can advise yourself on how you can do this. If they are strings,
pass strings, if they are integers, pass integers. Don't pass pointers.

Perhaps you need to write a function to capture the values.

If you are doing a searched update (as seems likely, from what you say
here) you are going to be better off defining a separate update object,
such as a TIB_DSQL, to fire off the update and disable editing in the tree
data altogether. If all it's ever going to be used for is to do these
updates from the tree, you can probably avoid the separate function and put
all the value-capture code inside its OnPrepareSQL event. You can then
avail yourself of SQLWhereItems.

After the searched update has executed and committed, you will need to
refresh the tree dataset. I don't know what the implications are for your
tree - repopulate a stringlist and relocate on the affected node?

Hope this helps some.

Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________