0
votes

I am having a small problem with datasnap in delphi Xe5.

I need to run dynamic queries on the server side. I am using an ADO connection on the server methods.

Server Procedure:

var
qryNew: TADOQuery;
dspNew: TDatasetProvider;
begin
    qryNew := TADOQuery.Create(nil);
    qryNew.Connection := Adoconnection1;
    qryNew.SQL.Text := SQL;
    qryNew.Name := 'qry'+IntToStr(1);
    dspNew := TDatasetProvider.Create(nil);
    dspNew.Name := 'dsp'+IntToStr(1);
    dspNew.Dataset := qryNew;
    qryNew.Open;
    Result := dspNew.Name;
end;

Client side procedure:

ClientDataset1.ProviderName :=clientmodule3.ServerMethods1Client.GetDataForClient('Select top 10 * from ODBC.trans_day_2009_1111;');

On the main form i have a SQLconnection, DSProvider connection and a client dataset. When I try to set the provider name for the client with the above code, i get the error "Remote error: Provider not exported : DSP1"

1

1 Answers

0
votes

Usually (not always), error messages are helpful if you spend the time to understand them. If it says the provider is not exported, you should have checked why it wasn't - i.e. the doc says:

"To enable the remote data module to pass calls to the provider, the provider's Exported property must be True, and its Owner property must specify the remote data module."

http://docwiki.embarcadero.com/Libraries/XE5/en/Datasnap.Provider.TDataSetProvider

Your provider has no owner.