Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Sessions and memory tables
Tue, Apr 25 2006 9:59 AMPermanent Link

"Mike Saunders"
DBISAM 3.27 Delphi 7

Probably an obvious explanation but afraid I cant see it

The following code works fine when the databasename of the Query is set
to point to a local location (ie LAN with sessionname as Default).
However if databasename points to a remote server (using sessionname)
then whilst the query works fine the Savetotable fails with nothing
placed in the memory table

I have also noted that when using Queries to restructure memory tables
they work fine when again set to LAN locations but not remote servers
Surely as the databasename of memory tables is 'Memory' and not a
physical location then it it is inconsistent that one fails whilst the
other works


Many thanks

Mike


with DM.tbQuery do
 begin
  Close;
  Requestlive := false;
  SQL.Clear;
  SQL.Add('Select PtPattern from Patterns where Ptshelf >= ''200'' ');
  Open;
  CreateQMemTable('TestTable');      
  SaveToTable('Memory','TestTable');
  DM.tmMemory.TableName := 'TestTable';
  DM.tmMemory.open;
 end;

procedure CreateQMemTable(memtable :string);
var TableToCreate: TDBISAMTable;
begin
 DM.tmMemory.close;
 if DM.tmMemory.exists then DM.tmMemory.DeleteTable;  
 TableToCreate:=TDBISAMTable.Create(Application);
 try
   with TableToCreate do
     begin
       DatabaseName:='Memory';
       TableName:= memtable;
       Active := False;
       Exclusive:=True;
       if not Exists then CreateTable;
     end
 finally
   TableToCreate.Free;
 end;
end;
Tue, Apr 25 2006 11:13 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mike,

<< The following code works fine when the databasename of the Query is set
to point to a local location (ie LAN with sessionname as Default). However
if databasename points to a remote server (using sessionname) then whilst
the query works fine the Savetotable fails with nothing placed in the memory
table >>

You need to make sure that the TDBISAMTable component that you're using to
open the in-memory table is using the remote session and is referencing the
"Memory" database on the database server, not the local "Memory" database
using the local session.  When you execute SaveToTable on a remote query and
specify the "Memory" database, the data will be written to the specified
table in the remote database server's "Memory" database, not the local
"Memory" database.

<< I have also noted that when using Queries to restructure memory tables
they work fine when again set to LAN locations but not remote servers Surely
as the databasename of memory tables is 'Memory' and not a physical location
then it it is inconsistent that one fails whilst the
other works >>

Same situation.  Always remember that remote is remote, and local is local,
and never shall the two meet.  You simply cannot mix them together.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image