Subject | Re: TIBOQuery with TDataSetProvider |
---|---|
Author | constantijnw |
Post date | 2004-06-25T23:39:59Z |
Hi Walter,
I think I've presented the same problem in messageid 31593 (and earlier).
The DataSetProvider generates SQL statements automatically and uses
the access component's SQL or CommandText property. Unfortunately it
looks as if TIBOQuery (the only choice you have) doesn't accept these
statements.
The Client Dataset's CommandText property lets you execute ad hoc SQL
statements that are treated the same way as the update statements.
I'm still waiting for a reaction to my question.
I've uploaded TestDsp.zip in the Files section. Feel free to extend
this demo with using the (failing) CommandText property. The demo
includes dbx components for comparison.
Constantijn
I think I've presented the same problem in messageid 31593 (and earlier).
The DataSetProvider generates SQL statements automatically and uses
the access component's SQL or CommandText property. Unfortunately it
looks as if TIBOQuery (the only choice you have) doesn't accept these
statements.
The Client Dataset's CommandText property lets you execute ad hoc SQL
statements that are treated the same way as the update statements.
I'm still waiting for a reaction to my question.
I've uploaded TestDsp.zip in the Files section. Feel free to extend
this demo with using the (failing) CommandText property. The demo
includes dbx components for comparison.
Constantijn
--- In IBObjects@yahoogroups.com, Walter Ogston <ogstoncw@w...> wrote:
> Dear Friends,
>
> With D7 Ent I am using a TDataSetProvider to link TIBOQuery to
> TClientDataset, over a SOAP connection. Here is the .dfm code for the
> remote data module:
>
> object DataSetProvider1: TDataSetProvider
> DataSet = IBOQuery1
> Options = [poAllowCommandText]
> Left = 368
> Top = 352
> end
> ...
> object IBOQuery1: TIBOQuery
> Params = <>
> IB_Connection = IBODatabase1
> IB_Transaction = IBOTransaction1
> RecordCountAccurate = True
> SQL.Strings = (
> '')
> FieldOptions = []
> Left = 280
> Top = 304
> end
> object IBOTransaction1: TIBOTransaction
> IB_Connection = IBODatabase1
> AutoCommit = True
> Isolation = tiCommitted
> Left = 192
> Top = 304
> end
>
> and in the client datamodule:
>
> object ClientDataSet1: TClientDataSet
> Aggregates = <>
> Params = <>
> ProviderName = 'DataSetProvider1'
> RemoteServer = SoapConnection1
> Left = 112
> Top = 308
> end
>
> Now in code I do:
> with fDataMod.ClientDataSet1 do begin
> Active := False;
> fDataMod.ClientDataSet1.CommandText := Trim(mmoSQL.Lines.Text);
> Active := True;
> end;
>
> The first time I execute this, everything works as expected.
>
> Then I change the SQL string and execute this code again, and on the
> statement Active := False; I get ERemotableException with message
'Blank
> SQL Statement not allowed'.
>
> The third time, the Active := False statement doesn't cause any problem
> (the dataset is already inactive) but on the Active := True
statement, the
> old result set appears in the ClientDataSet - the query is not
updated to
> the new SQL.
>
> This all worked in an earlier version using TIBQuery and
TIBTransaction in
> place of the IBO components.
>
> Am I doing something wrong, or failing to do something right, or is
this
> kind of thing beyond the capabilities of the IBO TDataset descendents?
>
> Thanks,
>
> Walter
>
> /*----------------
> C. Walter Ogston
> ogstoncw@w... Kalamazoo, Michigan
> */