Subject | RE: [IBO] Params ? not working, ? or master detail relationship. HELP PLEASE! |
---|---|
Author | adrian |
Post date | 2004-04-11T09:49:56Z |
Well Helen
I tried it as follows
If Not PraxData.IODIBOQuery.Prepared then
PraxData.IODIBOQuery.Prepare;
//PraxData.PPatientQuery.Active := False;
PraxData.PPatientQuery.SQL.Clear;
PraxData.PPatientQuery.SQL.Add('SELECT * FROM PATIENT WHERE
PATIENTID=:IODPATID');
PraxData.PPatientQuery.DataSource := PraxData.IODDataSource;
If Not PraxData.PPatientQuery.Prepared then
PraxData.PPatientQuery.Prepare;
PraxData.IODIBOQuery.Open;
//PraxData.IODIBOQuery.Active := True;
PraxData.PPatientQuery.Active := True;
This results in the Master Query being populated, but only the first
record in the child displaying, and when scrolling, no other records
displayed.
Note .. if I comment out PraxData.PPatientQuery.Active := True; , then
the master Query is populated, and NO! records show in the child.
Thanks
Adrian
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: 11 April 2004 10:09 AM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] Params ? not working, ? or master detail
relationship. HELP PLEASE!
Hello Adrian,
At 07:00 PM 10/04/2004 +0200, you wrote:
guess you will be waiting a few days for that, as Jason is very much
detached from work issues during Easter, because of his church
commitments.
In the meantime, I can't offer a reason why your code worked in an older
IBO version and doesn't work now with IBO 4.3. My observation is that I
would not have expected it to work in *any* IBO version at all, because
the
logic is wrong...so perhaps you are seeing a newer version of IBO that
is
no longer tolerant to the logic error in your code.
For the master-detail logic to work properly for the code model you
provided, the attributes of the master-detail relationship need to be
established *before* either of the datasets is opened. The way you have
it, you open the dataset and *afterwards* try to set up the
detail-to-master relationship.
Could you set up a test using this sequence instead?
{Set master query's SQL}
{assume that is done}
if not PraxData.IODIBOQuery.Prepared then
PraxData.IODIBOQuery.Prepare;
{Childs datasource is set}
PraxData.PPatientQuery.SQL.Clear;
PraxData.PPatientQuery.SQL.Add('SELECT * FROM PATIENT WHERE
PATIENTID=:IODPATID');
PraxData.PPatientQuery.DataSource := PraxData.IODDataSource;
if not PraxData.PPatientQuery.Prepared then
PraxData.PPatientQuery.Prepare;
(At this point, the Datasource linking should take care of populating
the
'IOPATID' parameter; or throw an exception if it can't connect the two)
PraxData.IODIBOQuery.Open;
(Here, the master dataset should open the detail dataset; and then open
each new detail set as you scroll through the master)
Another thought: how old is your old IBO version? Perhaps it is too
old
to know about KeyLinks...
Helen
________________________________________________________________________
___
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 !
_____
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/IBObjects/
* To unsubscribe from this group, send an email to:
IBObjects-unsubscribe@yahoogroups.com
<mailto:IBObjects-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .
[Non-text portions of this message have been removed]
I tried it as follows
If Not PraxData.IODIBOQuery.Prepared then
PraxData.IODIBOQuery.Prepare;
//PraxData.PPatientQuery.Active := False;
PraxData.PPatientQuery.SQL.Clear;
PraxData.PPatientQuery.SQL.Add('SELECT * FROM PATIENT WHERE
PATIENTID=:IODPATID');
PraxData.PPatientQuery.DataSource := PraxData.IODDataSource;
If Not PraxData.PPatientQuery.Prepared then
PraxData.PPatientQuery.Prepare;
PraxData.IODIBOQuery.Open;
//PraxData.IODIBOQuery.Active := True;
PraxData.PPatientQuery.Active := True;
This results in the Master Query being populated, but only the first
record in the child displaying, and when scrolling, no other records
displayed.
Note .. if I comment out PraxData.PPatientQuery.Active := True; , then
the master Query is populated, and NO! records show in the child.
Thanks
Adrian
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: 11 April 2004 10:09 AM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] Params ? not working, ? or master detail
relationship. HELP PLEASE!
Hello Adrian,
At 07:00 PM 10/04/2004 +0200, you wrote:
>I upgraded to the latest release, and then did a build all.is
>Previously this module was working just fine.
>Now it returns no records
>
>{Master}
>PraxData.IODIBOQuery.Active := True;
>{Childs datasource is set}
>PraxData.PPatientQuery.DataSource := PraxData.IODDataSource;
>PraxData.PPatientQuery.SQL.Clear;
>PraxData.PPatientQuery.SQL.Add('SELECT * FROM PATIENT WHERE
>PATIENTID=:IODPATID');
>PraxData.PPatientQuery.Open;
>PraxData.PPatientQuery.Active := True;
>
>Previously PPAtientQuery would be populated with data, now it isn't.
>
>I have changed none of my source code at all!
>Has it got something to do with the parameter.
>The PPatientQuery is in a DATAMODULE, and I'm using TIBOQuery's
>The original PPatientQuery definition doesn't have any parameters. It
>just in this code portion that a parameter is required.I see from another post that you want Jason to answer this himself. I
>
guess you will be waiting a few days for that, as Jason is very much
detached from work issues during Easter, because of his church
commitments.
In the meantime, I can't offer a reason why your code worked in an older
IBO version and doesn't work now with IBO 4.3. My observation is that I
would not have expected it to work in *any* IBO version at all, because
the
logic is wrong...so perhaps you are seeing a newer version of IBO that
is
no longer tolerant to the logic error in your code.
For the master-detail logic to work properly for the code model you
provided, the attributes of the master-detail relationship need to be
established *before* either of the datasets is opened. The way you have
it, you open the dataset and *afterwards* try to set up the
detail-to-master relationship.
Could you set up a test using this sequence instead?
{Set master query's SQL}
{assume that is done}
if not PraxData.IODIBOQuery.Prepared then
PraxData.IODIBOQuery.Prepare;
{Childs datasource is set}
PraxData.PPatientQuery.SQL.Clear;
PraxData.PPatientQuery.SQL.Add('SELECT * FROM PATIENT WHERE
PATIENTID=:IODPATID');
PraxData.PPatientQuery.DataSource := PraxData.IODDataSource;
if not PraxData.PPatientQuery.Prepared then
PraxData.PPatientQuery.Prepare;
(At this point, the Datasource linking should take care of populating
the
'IOPATID' parameter; or throw an exception if it can't connect the two)
PraxData.IODIBOQuery.Open;
(Here, the master dataset should open the detail dataset; and then open
each new detail set as you scroll through the master)
Another thought: how old is your old IBO version? Perhaps it is too
old
to know about KeyLinks...
Helen
________________________________________________________________________
___
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 !
_____
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/IBObjects/
* To unsubscribe from this group, send an email to:
IBObjects-unsubscribe@yahoogroups.com
<mailto:IBObjects-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .
[Non-text portions of this message have been removed]