3  DATA ACCESS,
   "/"
 TStoredProc, TDatabase, TUpdateSQL, TBatchMove  TSession ,  ,  ,  , TQuery  TDataSource,          ,    .
3.1  TStoredProc
 TStoredProc      C++ Builder  ,     .           SQL,    .      ,    ,       (   TStoredProc    ,   TQuery, ,         ,  TStoredProc      ),     (        )     ,   -     .       ,     .
   TStoredProc: DatabaseName -  (alias)  ,     , StoredProcName -  , Params (  TParams) -   ,    ,   TDataSet: Active, Fields, Eof, Bof, State  . " :  -  , ParamByName -  ,   . TStoredProc    ,   TDataSet: Append, AppendRecord, Close, Open, Delete, Edit, Post  . .
     .       IB Database,     C++ Builder.   ,       TStoredProc,  TEdit   TButton.    DatabaseName 
42
 Data Access,    /
StoredProcl    IB Database,    .        StoredProcName,               (. 3.1).
Database Login
Database:
User Name: Password:
IBLOCAL
USER101
OK       I
Cancel
J
. 3.1.   
    InterBase       SYSDBA   MASTERKEY (    ).
    (     )    StoredProcName         .     PROC2,          SAL,   IB Database  :
CREATE  PROCEDURE   PROC2     RETURNS   (       A  INTEGER)   AS
BEGIN
SELECT  SUM(SAL)   FROM  EMP   INTO A;
END
         ,      . 2.
  Params,           (. 3.2).
   OnClick   Button 1:
void _fastcall TForml::Button1Click(TObject  *Sender)
{
StoredProd ->ExecProc();
Editl ->Text=StoredProc1->Params->Items[0]->AsString;
}
43