[View Borland Home Page][View Product List][Search This Web Site][View Available Downloads][Join Borland Online][Enter Discussion Area][Send Email To Webmaster]
Delphi Devsupport

Frequently Asked Questions

Using Stored Procedures

Question:

How do I use stored procedures in a multi-tier environment?

Answer:

You'll need to get the provider interface and set the

parameters before trying to open the client dataset.

Unfortunately there is no way to do this at design time,

but it should work OK at run time.  Here is some code that

shows basically what you need to do:

procedure TDBClientTest.Button3Click(Sender: TObject); var Params: Variant; begin ClientData.Provider := RemoteServer1.GetProvider('ProviderName'); Params := VarArrayCreate([0, 1], varVariant); Params[0] := VarArrayOf(['@InParam1', 101]); Params[1] := VarArrayOf(['@InParam2', 'test_param']); ClientData.Provider.SetParams(Params); ClientData.Open; end;
This example assumes the stored procedure takes 2 parameters, and binds them by name. If you need to update the data returned from a stored procedure, you will need to use a TUpdateSQLProvider.

Back To Faq Index
Borland Online
Trademarks & Copyright © 1997 Borland International, Inc.