I've got no idea how to use TIbDataSet for any purpose but I can show 
you how to use TIbQuery to do this. Besides, TIbQuery is probably your 
best option any way since it allows you to put in sn SQL query that will 
run against the server.

(1) You set up your "Master" data set. I'm making no assumptions about 
your Master dataset, except that it is a TDataSet descendent (this 
includes TIbQuery, TIbDataSet, TBDETable - and many many others). Make 
sure your "Master" data set includes the fields you want to use to 
filter your "Client" data set.
(2) Put a TDataSource on your form/data module and link it to your 
Master DataSet.
(3) Put a TIbQuery on your form/data module, link it to your TIbDatabase 
and your TIbTransaction. Link it's DataSource property to the 
TDataSource at (2).
(4) In your TIbQuery.SQL put an SQL statement that returns the fields 
your are interested in and makes use of the fields in the "Master" data set.

Ex: If you have a CLIENTS table and an ORDERS table, and the ORDERS 
tables has an ID_CLIENT field, after you made sure the Master dataset 
includes the ID_CLIENT field, you can put something like this in the 
"Detail" dataset's SQL statement: "SELECT * FROM ORDERS WHERE 
ID_CLIENT=:ID_CLIENT". Your statement may be as complex as you need it 
to be. The "Detail" dataset will pe "refreshed" every time the row in 
the "Master" dataset is changed.

Milet Maricuelo wrote:
> Hello,
> Im using TIBDataSet...how can I use it to connect master-detail tables? 
>
> Thanks you,
> milet
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> [EMAIL PROTECTED]
> Sent: Friday, March 09, 2007 8:00 PM
> To: delphi-db@elists.org
> Subject: Delphi-DB Digest, Vol 50, Issue 2
>
>
> Send Delphi-DB mailing list submissions to
>       delphi-db@elists.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>       http://www.elists.org/mailman/listinfo/delphi-db
> or, via email, send a message with subject or body 'help' to
>       [EMAIL PROTECTED]
>
> You can reach the person managing the list at
>       [EMAIL PROTECTED]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Delphi-DB digest..."
>
>
> Today's Topics:
>
>    1. Re: Using TQuery (Ralph D. Wilson II)
>    2. RE: Using TQuery (Paul van Mil)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 06 Mar 2007 19:49:07 -0600
> From: "Ralph D. Wilson II" <[EMAIL PROTECTED]>
> Subject: Re: Using TQuery
> To: "Moderated discussion list about database programming with
>       Borland's       Delphi" <delphi-db@elists.org>
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset="us-ascii"; format=flowed
>
>
>
> At 12:44 PM 3/5/2007, you wrote:
>   
>> procedure TAutoLoopBldrForm.NewLoopButtonMouseUp(Sender: TObject;
>>
>>   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
>>
>>
>>
>>   begin
>>
>>           PSQLQuery1.Close ;    <= I am going to have to assume 
>> that PSQLQuery1 has been created somewhere but have you you created 
>> any sort of database connection?
>>
>>           PSQLQuery1.Params[0].AsString;  <=  This is a total 
>> nonsense . . . it does nothing and has absolutely no meaning in any 
>> way.  Are you trying to set the parameter's value?
>>
>>           PSQLQuery1.ExecSQL;
>>
>>       DeviceNotebookMouseUpAlias(Sender, Button, Shift, X, Y);
>>
>>
>>
>> end;
>>
>>
>>     
>
> Ralph D. Wilson II
> Systems Analyst
>
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 07 Mar 2007 13:29:32 +0100
> From: Paul van Mil <[EMAIL PROTECTED]>
> Subject: RE: Using TQuery
> To: Moderated discussion list about database programming with
>       Borland's Delphi        <delphi-db@elists.org>
> Message-ID:
>       <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=iso-8859-1
>
> At first sight, 3 "problems" in TAutoLoopBldrForm.NewLoopButtonMouseUp:
>
>       What's the Query-parameter ?
>       PSQLQuery1.Params[0].AsString := <put here your query-params, e.g.
> image-name, record-indentifier>
>
>       PSQLQuery1.ExecSQL --> what's your requested output (ExecSQL can
> only output 1 single value)
>                                       Maybe better use PSQLQuery1.Open;,
> get whatever field-values you need, then PSQLQuery.Close;
>
>       DeviceNotebookMouseUpAlias(Sender, Button, Shift, X, Y);        Who
> is the Sender ? Since you are clicking on a TButton,
>       
> your sender will be the TButton, but your DeviceNotebookMouseUpAlias
>       
> will only run if the Object is a TImage (if Sender is TImage);
>
>
>
> Paul van Mil
> Senior Developer
>
> MAD-Systems
> Burg. van Suchtelenstr. 26
> 6641 XN  Beuningen (Gld)
> The Netherlands
> Url: www.madsystems.nl
>
> Tel.: +31 (0)24-366 1501
> Fax.: +31 (0)24-366 1502
> Mob.: +31 (0)6 2251 4084
> Email: [EMAIL PROTECTED]
>
> *************************************************************************
> Disclaimer: MAD-Systems is de enige opdrachtnemer van alle werkzaamheden.
> Nederlands recht is van toepassing. De aansprakelijkheid van MAD-Systems is
> beperkt tot de uitkering die plaatsvindt onder de verzekering van
> MAD-Systems tegen beroepsaansprakelijkheid.
>
> Disclaimer: MAD-Systems is the exclusive contractual party with respect to
> all work and services undertaken.
> Dutch laws shall apply. The aggregate liability of MAD-Systems shall be
> limited to the proceeds available under MAD-Systems professional liability
> insurance.
>
> This e-mail message is intended exclusively for the addressee(s). If the
> e-mail was sent to you by mistake, would you please contact us immediately
> by e-mail through "[EMAIL PROTECTED]".
> In that case, we also request that you destroy the e-mail and that you
> neither use the contents nor disclose them in any manner to third parties,
> because the message may contain confidential information which is protected
> by professional secrecy.
>
> Any addressee should be aware that internet e-mail is subject to risks;
> MAD-Systems therefore denies any responsibility for damages resulting from
> the use of Internet e-mail.
> *************************************************************************
> This email is checked on virusses through Norton Antivirus, updated 
> 2007-03-06
>
>
> ------------------------------
>
> _______________________________________________
> Delphi-DB mailing list
> Delphi-DB@elists.org
> http://www.elists.org/mailman/listinfo/delphi-db
>
>
> End of Delphi-DB Digest, Vol 50, Issue 2
> ****************************************
> _______________________________________________
> Delphi-DB mailing list
> Delphi-DB@elists.org
> http://www.elists.org/mailman/listinfo/delphi-db
>
>   

_______________________________________________
Delphi-DB mailing list
Delphi-DB@elists.org
http://www.elists.org/mailman/listinfo/delphi-db

Reply via email to