Subject Re: [IBO] Locate and Master Detail
Author Marco Menardi <mmenaz@lycosmail.com>
--- In IBObjects@yahoogroups.com, "wayne" <waynef@w...> wrote:
> mmm, maybe I am confused,,, Jason who else ,, DEFINETLY it can not
be you.
>
> You have helped me in the PAST,, I never actually thanked you.
> I am thankfull and appreciate all the help from you, and Helen and
all the
> rest.
>
> My problem is this I guess. ::
>
> My TIB_Queries is "select * from client_account"
>
> It does not have a Parameter so when opened it gets all the data accross
> the wire (" I assume "). This is what I would like to avaoid.
> Is this statement correct ?

This is correct, but is not this way that I do it with IBO.
I use native compoennts, and query with ColorScheme set to true.
Then I don't OPEN the query, I put them in SEARCH MODE
(qryCustgomer.Search). This is only client-side stuff, so the server
has no work to do.
Then, if the user wants to find a specific record to edit it, he fills
the fields he wants to use for the search, and presses the "first"
button on the navigation bar. Then a dataset of all the matching rows
is asked to the server, and he can start edit this small amount of
data (usually only one record). After the post, the query
automatically returns in Search state.
If the user instead wants to add a record, he presses the Insert
button of the IB_UpdateBar, color changes from blue to green, and he
inserts the record, posts it and returns in Search mode. Simple,
powerful and very effective (thansk IBO ;).
(btw, your problem is that you want to edit a Prepared but not Open
query. If query is not open, you don't have any row to edit in it's
buffers. Prepare <> Open).
regards
Marco Menardi


>
> I use the same Form for Insert and Edit.
>
> file://------------------------------------------------------
> The difference being when *Editing*
> I Do :
> (1)
> qryAcc.prepare;
> qryEnq.prepare;
> (2)
> if qryAcc.Locate('ID', id, []) then
> begin
> qryAcc.Edit;
> qryEnq.Edit;
>
> qryAcc.edit is opened and has an id of say (10)
> qryEnq.Edit; is opened and does no have an ID of 10 **ERROR***
> qryAcc and qryEnq are related "master detail 1:1".
>
> file://------------------------------------------------------
> When *Inserting* I Do
> (1)
> qryAcc.prepare;
> qryEnq.prepare;
> (2)
> begin
> qryAcc.Insert;
> qryEnq.Insert;
>
>
>
> ""Jason Wharton"" <jwharton@i...> wrote in message
> news:00e301c2a78c$0d873520$dc756a41@CX170673E...
> > Your request is confusing to me.
> > How do you expect to Edit a record if the dataset isn't opened?
> >
> > Jason Wharton
> > CPS - Mesa AZ
> > http://www.ibobjects.com
> >
> > -- We may not have it all together --
> > -- But together we have it all --
> >
> >
> > ----- Original Message -----
> > From: <waynef@w...>
> > To: <IBObjects@yahoogroups.com>
> > Sent: Wednesday, December 18, 2002 12:30 AM
> > Subject: [IBO] Locate and Master Detail
> >
> >
> > > I have two TIB_Queries
> > > set up in a Master Detail.
> > >
> > > I then do a locate on the master Query
> > > and if found
> > >
> > > I put the Master in Edit mode, then the detail in
> > > edit mode ( 1:1 relation ).
> > >
> > > My problem is that the Detail never goes into edit mode.
> > > so it seems I have to do a locate on that query as well
> > >
> > > Here are the details
> > >
> > > (1)
> > > qryAcc.prepare; // Open
> > > qryEnq.prepare; // Open
> > >
> > > (2)
> > > if qryAcc.Locate('ID', id, []) then
> > > begin
> > > qryAcc.Edit;
> > > qryEnq.Edit;
> > >
> > >
> > > I have noticed that if I do not use prepare but Open,,
> > > it works ...
> > >
> > > waht is the best way of doing this, I would hate to have to use
> > > 'OPEN'.
> > >
> > > Thanks
> > > Wayne.
> >
> >
> >
> >
> >
>
___________________________________________________________________________
> > IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase
> > without the need for BDE, ODBC or any other layer.
> >
>
___________________________________________________________________________
> > http://www.ibobjects.com - your IBO community resource for Tech Info
> papers,
> > keyword-searchable FAQ, community code contributions and more !
> >
> > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
> >
> >
> >