<< Click to Display Table of Contents >> Navigation: Apollo VCL Components > Apollo VCL Component Reference > TApolloServerDLL > TApolloServerDLL Properties > ProcName |
Declaration
ProcName: String
Description
The name of the procedure to be executed. At design-mode, if connected to the server via the ApolloConnection property, a drop-down list will display the names of all procedures found in .DLLs within the DatabaseName.
Delphi Example
Here's another procedure on the client that will add a new record to a table that is not already opened by the client and replace some field values.
procedure TForm1.InsertRecord;
begin
with ApolloServerDLL1 do
begin
// Always set ProcName first
ProcName := 'InsertRecord';
// Check to see if server has a copy of all the parameters we need.
// Ignore (do not create) if already exists
if ProcParams.FindParam('First') = nil then
ProcParams.CreateParam(ftString, 'First', ptInput);
if ProcParams.FindParam('Last') = nil then
ProcParams.CreateParam(ftString, 'Last', ptInput);
if ProcParams.FindParam('Age') = nil then
ProcParams.CreateParam(ftInteger, 'Age', ptInput);
if ProcParams.FindParam('State') = nil then
ProcParams.CreateParam(ftString, 'State', ptInput);
if ProcParams.FindParam('Salary') = nil then
ProcParams.CreateParam(ftFloat, 'Salary', ptInput);
// Return Value
if ProcParams.FindParam('Success') = nil then
ProcParams.CreateParam(ftBoolean, 'Success', ptOutput);
// Set values to be replaced
ProcParams.ParamByName('First').AsString := 'John';
ProcParams.ParamByName('Last').AsString := 'Williams';
ProcParams.ParamByName('Age').AsInteger := 36;
ProcParams.ParamByName('State').AsString := 'CA';
ProcParams.ParamByName('Salary').AsFloat := 567.89;
ExecProc;
if ProcParams.ParamByName('Success').AsBoolean then
ShowMessage('Insert was successfull')
else
ShowMessage('Error inserting record');
end;
end;
See Also
ExecProcExecProc, ActiveTApolloServerDLL_Active , ProcNameProcName