Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Access DBISAM Tables from a Server Procedure
Mon, Jul 9 2007 4:11 PMPermanent Link

Kevin Kozlowski
I'm using DBISAM v4.25 with Delphi 2007, and am just getting around to using server side
procedures. Could someone point me to an example on how to access (read and update) a
DBISAM table from a server procedure?

Thanks,

-Kevin
Mon, Jul 9 2007 5:16 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Kevin,

<< I'm using DBISAM v4.25 with Delphi 2007, and am just getting around to
using server side procedures. Could someone point me to an example on how to
access (read and update) a DBISAM table from a server procedure? >>

Just declare the TDBISAMTable component local to the
TDBISAMEngine.OnServerProcedure event handler, and make sure to set its
SessionName to the same as the ServerSession parameter passed into the event
handler like this:

procedure TMyForm.ServerProcedure(Sender: TObject;
 ServerSession: TDBISAMSession; const ProcedureName: String);
var
  TempTable: TDBISAMTable;
  TempDescription: string;
  TempPath: string;
begin
  if (AnsiCompareText(ProcedureName,'UpdateMyTable')=0) then
     begin
     TempTable:=TDBISAMTable.Create(nil);
     try
        Engine.GetServerDatabase('Main',TempDescription,TempPath);
        with TempTable do
           begin
           SessionName:=ServerSession.SessionName;
           DatabaseName:=TempPath;
           TableName:='MyTable';
           Open;
           try
               { Update table here, etc. }
           finally
               Close;
           end;
           end;
      finally
          FreeAndNil(TempTable);
      end;
      end;
end;

--
Tim Young
Elevate Software
www.elevatesoft.com

Image