Subject | Ib Objects Question |
---|---|
Author | Ricardo de Siqueira Feitosa |
Post date | 2001-02-13T19:43:39Z |
Hi Jason,
We are having troubles while using parameters with IBObjects.
We are developing a Client/Server application, where:
In the Server side, there's a remote data module with three components:
a TIBODatabase, a TIBOQuery and a TDataSetProvider linked to the query.
The Query's sql statement is:
"Select * from MyTable where Code1 = :Code1 and Code2 = :Code2".
The params "Code1" and "Code2" are both of Integer datatype and Input
paramtype.
In the client side, there's a datamodule with a TDComConnection, a
TClientDataSet linked to the
Server TDataSetProvider and a TDataSource linked to the ClientDataSet.
There is still a form with
a DbGrid which will show the ClientDataSet result set.
In the Client application, the code is:
DComConnection.Connected := True;
with ClientDataSet do
begin
Close;
FetchParams;
Params.ParamByName('Code1').asInteger := 146;
Params.ParamByName('Code2').asInteger := 30;
Open;
end;
Executing the application, there are three questions to consider:
1 - After opening the ClientDataSet, it returns empty (recordcount = 0),
but I'm sure that there's a record
with these two values (Code1 = 146 and Code2 = 30) in my Database.
2 - I tried to open the same query passing only one parameter (Code1, for
instance), and everything is ok.
The query returns the records with Code1 = 146. Why the IBObjects doesn't
work when passing two or
more parameters to the Server and why it works when passing only one
parameter to it?
3 - I tested the same application using the InterBase Express, and
everything is all right.
I hope you can help me solve this problem.
Thank you in advance.
P.S. I am a registered user of IB Objects full source code.
Ricardo de Siqueira Feitosa
feitosar@...
We are having troubles while using parameters with IBObjects.
We are developing a Client/Server application, where:
In the Server side, there's a remote data module with three components:
a TIBODatabase, a TIBOQuery and a TDataSetProvider linked to the query.
The Query's sql statement is:
"Select * from MyTable where Code1 = :Code1 and Code2 = :Code2".
The params "Code1" and "Code2" are both of Integer datatype and Input
paramtype.
In the client side, there's a datamodule with a TDComConnection, a
TClientDataSet linked to the
Server TDataSetProvider and a TDataSource linked to the ClientDataSet.
There is still a form with
a DbGrid which will show the ClientDataSet result set.
In the Client application, the code is:
DComConnection.Connected := True;
with ClientDataSet do
begin
Close;
FetchParams;
Params.ParamByName('Code1').asInteger := 146;
Params.ParamByName('Code2').asInteger := 30;
Open;
end;
Executing the application, there are three questions to consider:
1 - After opening the ClientDataSet, it returns empty (recordcount = 0),
but I'm sure that there's a record
with these two values (Code1 = 146 and Code2 = 30) in my Database.
2 - I tried to open the same query passing only one parameter (Code1, for
instance), and everything is ok.
The query returns the records with Code1 = 146. Why the IBObjects doesn't
work when passing two or
more parameters to the Server and why it works when passing only one
parameter to it?
3 - I tested the same application using the InterBase Express, and
everything is all right.
I hope you can help me solve this problem.
Thank you in advance.
P.S. I am a registered user of IB Objects full source code.
Ricardo de Siqueira Feitosa
feitosar@...