Title: How to execute stored procedure in client when use MIDAS
Question: Execute stored procedure in client
Answer:
This article shows you how to execute stored procedure in the client.
If your stored procedure returns a dataset, that means you should call Open method of TStoredProc, in this case , just use TDataSetProvider to connect to it. It does very well.
If your stored procedure does not return dataset, that means you should call ExecProc method of TStoreProc. The step is:
1 Add a method to your interface
procedure ExecProc(Params: Integer);
2 Write the code in the remote data module
procedure ExecProc(Params: Integer);
begin
StoredProc1.ParamByName('@Param').AsInteger := Params;
StoredProc1.ExecProc;
end;
3 On the client, you can call this procedure to execute procedure
DComConnection1.AppServer.ExecProc(1);
That is OK.
Good luck.