BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Parameter Passing between ClientDataSet and DataSetProvider

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Multi-Tier)
View previous topic :: View next topic  
Author Message
Joe Bain
Guest





PostPosted: Wed Jan 18, 2006 8:53 pm    Post subject: Re: Parameter Passing between ClientDataSet and DataSetProvi Reply with quote



Geoff Marshall wrote:

Quote:
I hope this is a much easier question to answer.

In my ClientDataSet I establish three parameters before opening it.
In the AfterOpen event I observe the parameters are correct.

The DataSetProvider is connected to a TIBDataSet. Both before and
after it is opened I observe the parameters to be NULL.

1. What am I forgetting to do that will cause the parameters to be
sent?

2. I note the help for the clientDataSet specifies that parameters
are only sent the first time the component is opened, and that
subsequently I should use the Execute method. Having tried that I
get an error "Execute not supported". Is the help file correct?
When I do get the parameters passed will they go each time?


Geoff Marshall

Answer 1.

On the server setup the TIBDataset like you want with the param in the
SQL. On the client set the the ProviderName of the CDS and right click
it and choose "Fetch Params". At run time the code looks like this.

cds.Params.ParamByName('FOO').value := 'Bar';
cds.open;


Answer 2.

To change the parameters, just close the cds, changes the params, and
open it. The execute method is only used if the provider does not
return a result set (ie an insert of delete query).


--------------
Joe Bain
www.iegsoftware.com

Back to top
Geoff Marshall
Guest





PostPosted: Thu Jan 19, 2006 3:20 am    Post subject: Parameter Passing between ClientDataSet and DataSetProvider Reply with quote



I hope this is a much easier question to answer.

In my ClientDataSet I establish three parameters before opening it.
In the AfterOpen event I observe the parameters are correct.

The DataSetProvider is connected to a TIBDataSet. Both before and after
it is opened I observe the parameters to be NULL.

1. What am I forgetting to do that will cause the parameters to be sent?

2. I note the help for the clientDataSet specifies that parameters are
only sent the first time the component is opened, and that subsequently
I should use the Execute method. Having tried that I get an error
"Execute not supported". Is the help file correct? When I do get the
parameters passed will they go each time?


Geoff Marshall
Back to top
Geoff Marshall
Guest





PostPosted: Sun Jan 22, 2006 11:30 pm    Post subject: Re: Parameter Passing between ClientDataSet and DataSetProvi Reply with quote



Joe Bain wrote:
Quote:
Geoff Marshall wrote:


I hope this is a much easier question to answer.

In my ClientDataSet I establish three parameters before opening it.
In the AfterOpen event I observe the parameters are correct.

The DataSetProvider is connected to a TIBDataSet. Both before and
after it is opened I observe the parameters to be NULL.

1. What am I forgetting to do that will cause the parameters to be
sent?

2. I note the help for the clientDataSet specifies that parameters
are only sent the first time the component is opened, and that
subsequently I should use the Execute method. Having tried that I
get an error "Execute not supported". Is the help file correct?
When I do get the parameters passed will they go each time?


Geoff Marshall


Joe, Thanks for your comment that's what I was doing but...

Quote:

Answer 1.

On the server setup the TIBDataset like you want with the param in the
SQL. On the client set the the ProviderName of the CDS and right click
it and choose "Fetch Params".

.... Nothing happens. No parameters. No nothing. Frustrated I am.


Back to top
Joe Bain
Guest





PostPosted: Mon Jan 23, 2006 1:53 pm    Post subject: Re: Parameter Passing between ClientDataSet and DataSetProvi Reply with quote

Geoff Marshall wrote:

Quote:
.... Nothing happens. No parameters. No nothing. Frustrated I
am.

I have never used a TIBDataset of the server side, I always use
TIBQuery. Try it with that. I have never had fetch params not work. Do
you override AS_GetParams on the server?


--
--------------
Joe Bain
www.iegsoftware.com

Back to top
Mark Horrocks
Guest





PostPosted: Mon Jan 23, 2006 11:34 pm    Post subject: Re: Parameter Passing between ClientDataSet and DataSetProvi Reply with quote

I may be wrong here but you can't use paramters with TIBDataset. I use
TIBDataset for inserts only and TIBQuery for all else. You can read the
params with TIBQuery.


Back to top
Joe Bain
Guest





PostPosted: Tue Jan 24, 2006 1:26 pm    Post subject: Re: Parameter Passing between ClientDataSet and DataSetProvi Reply with quote

Mark Horrocks wrote:

Quote:
I may be wrong here but you can't use paramters with TIBDataset. I
use TIBDataset for inserts only and TIBQuery for all else. You can
read the params with TIBQuery.

TIBDataset is a TIBQuery with a TIBUpdateSQL built in. You can access
the select params just like you would a TIBQuery. I am wondering if
IProviderSupport is not implemented properly in it.

Geoff, what version of Delphi and IBX are you using?

--
--------------
Joe Bain
www.iegsoftware.com

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Multi-Tier) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.