Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Datasets Remote Address
Wed, Mar 19 2014 3:15 AMPermanent Link

David Darlison

I am trialling EWB with a project using remote DBISAM datasets.
No problem set the RemoteAddress and off we go.
But on deployment I would probably have the EWB web server on the same machine as the DBISAM server and require the Remote addresses to be e.g. 192.168.1.254.
I can see in a large project  that a lot of datasets would be created in EWB and unless I'm missing something, I would have to change the remote address on each dataset.
Is there any way of grouping the datasets so 1 RemoteAddress gets changed.  
Wed, Mar 19 2014 4:26 AMPermanent Link

Uli Becker

David,

> Is there any way of grouping the datasets so 1 RemoteAddress gets changed.

You can edit the ini file of EWB Server where all datasets are stored.
Under Windows7 here:

C:\ProgramData\Elevate Software\Elevate Web Builder Web Server\ewbsrvr.ini

You can also copy and paste datasets here and edit the details in the UI
of the server.

I am just writing a tool with Delphi which handles all this stuff - but
no time to finish it for now. Frown

Uli


Wed, Mar 19 2014 9:12 AMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 3/19/2014 3:15 AM, David Darlison wrote:
> I am trialling EWB with a project using remote DBISAM datasets.
> No problem set the RemoteAddress and off we go.
> But on deployment I would probably have the EWB web server on the same machine as the DBISAM server and require the Remote addresses to be e.g. 192.168.1.254.
> I can see in a large project  that a lot of datasets would be created in EWB and unless I'm missing something, I would have to change the remote address on each dataset.
> Is there any way of grouping the datasets so 1 RemoteAddress gets changed.
>

I have not tried it but how about using 127.0.0.1 for the remote
address? (local loopback)

Assuming EWB web server and DBISAM server are on same computer this
should always work sicne they just need to talk to each other.

Raul
Wed, Mar 19 2014 11:53 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

David,

<< But on deployment I would probably have the EWB web server on the same
machine as the DBISAM server and require the Remote addresses to be e.g.
192.168.1.254. I can see in a large project  that a lot of datasets would be
created in EWB and unless I'm missing something, I would have to change the
remote address on each dataset. Is there any way of grouping the datasets so
1 RemoteAddress gets changed. >>

I would go with Uli's suggestion:  just open the .ini file (create it if it
doesn't exist), and throw in the dataset definitions in bulk.

Here's how we do it in the IDE in Delphi code:

const

  DATASET_SECTION = 'DataSet_';

function OSAppDataDirectory: String;
var
  TempBuffer: array[0..MAX_PATH] of Char;
  ResultLength: Integer;
begin
  FillChar(TempBuffer,((MAX_PATH+1)*SizeOf(Char)),0);
  ShlObj.SHGetSpecialFolderPathW(0,@TempBuffer,CSIDL_LOCAL_APPDATA,False);
  ResultLength:=WStrLen(pChar(@TempBuffer));
  SetLength(Result,ResultLength);
  Move(TempBuffer[0],pChar(Result)^,(ResultLength*SizeOf(Char)));
end;

function GetAppDataDirectory: String;
begin
  {$WARN SYMBOL_PLATFORM OFF}
  Result:=IncludeTrailingBackslash(OSAppDataDirectory)+'Elevate Software'+
          PathDelim+'Elevate Web Builder';
  if (not DirectoryExists(Result)) then
     ForceDirectories(Result);
  {$WARN SYMBOL_PLATFORM ON}
end;

function GetIniFileName: String;
begin
  {$WARN SYMBOL_PLATFORM OFF}
  Result:=GetAppDataDirectory+PathDelim+ChangeFileExt(ExtractFileName(Application.ExeName),'.ini');
  {$WARN SYMBOL_PLATFORM ON}
  if (not FileExists(Result)) and
      FileExists(GetAppDataDirectory+PathDelim+'webbuilder.ini') then
     begin
     CopyFile(GetAppDataDirectory+PathDelim+'webbuilder.ini',GetAppDataDirectory,
              ChangeFileExt(ExtractFileName(Application.ExeName),'.ini'));
     DeleteFile(GetAppDataDirectory+PathDelim+'webbuilder.ini');
     end;
end;

procedure TMainForm.AddExampleDataSets;
var
  TempIniFile: TMemIniFile;
begin
  {$WARN SYMBOL_PLATFORM OFF}
  TempIniFile:=TMemIniFile.Create(GetIniFileName);
  try
     with TempIniFile do
        begin
        { Create customer dataset }
        WriteInteger(DATASET_SECTION+'Customer','EngineType',1);
        WriteString(DATASET_SECTION+'Customer','Description','Customer
Dataset for Master-Detail Database Example Project');
        WriteInteger(DATASET_SECTION+'Customer','DataSetType',0);
        WriteString(DATASET_SECTION+'Customer','TableName','customer');
        WriteString(DATASET_SECTION+'Customer','PrivateDir',OSTempDirectory);
        WriteString(DATASET_SECTION+'Customer','DatabaseName',IncludeTrailingBackslash(GetDocumentsDirectory)+'masterdetail\data');
        { Create customer orders dataset }
        WriteInteger(DATASET_SECTION+'CustomerOrders','EngineType',1);
        WriteString(DATASET_SECTION+'CustomerOrders','Description','Customer
Orders Dataset for Master-Detail Database Example Project');
        WriteInteger(DATASET_SECTION+'CustomerOrders','DataSetType',1);
        WriteString(DATASET_SECTION+'CustomerOrders','SQL','SELECT * FROM
custord<#CR#><#LF#>WHERE CustomerID={CustomerID=''ADF''}<#CR#><#LF#>');
        WriteString(DATASET_SECTION+'CustomerOrders','BaseTableName','custord');
        WriteString(DATASET_SECTION+'CustomerOrders','PrivateDir',OSTempDirectory);
        WriteString(DATASET_SECTION+'CustomerOrders','DatabaseName',IncludeTrailingBackslash(GetDocumentsDirectory)+'masterdetail\data');
        { Create customer items dataset }
        WriteInteger(DATASET_SECTION+'CustomerItems','EngineType',1);
        WriteString(DATASET_SECTION+'CustomerItems','Description','Customer
Items Dataset for Master-Detail Database Example Project');
        WriteInteger(DATASET_SECTION+'CustomerItems','DataSetType',1);
        WriteString(DATASET_SECTION+'CustomerItems','SQL','SELECT * FROM
custitm<#CR#><#LF#>WHERE
OrderID={OrderID=''ADF-2012618-10162438''}<#CR#><#LF#>');
        WriteString(DATASET_SECTION+'CustomerItems','BaseTableName','custitm');
        WriteString(DATASET_SECTION+'CustomerItems','PrivateDir',OSTempDirectory);
        WriteString(DATASET_SECTION+'CustomerItems','DatabaseName',IncludeTrailingBackslash(GetDocumentsDirectory)+'masterdetail\data');
        { Create products dataset }
        WriteInteger(DATASET_SECTION+'Products','EngineType',1);
        WriteString(DATASET_SECTION+'Products','Description','Products
Dataset for Master-Detail Database Example Project');
        WriteInteger(DATASET_SECTION+'Products','DataSetType',0);
        WriteString(DATASET_SECTION+'Products','TableName','product');
        WriteString(DATASET_SECTION+'Products','PrivateDir',OSTempDirectory);
        WriteString(DATASET_SECTION+'Products','DatabaseName',IncludeTrailingBackslash(GetDocumentsDirectory)+'masterdetail\data');

        { Create albums dataset }
        WriteInteger(DATASET_SECTION+'Albums','EngineType',1);
        WriteString(DATASET_SECTION+'Albums','Description','Albums Dataset
for CD Collector Audio Plugin Example Project');
        WriteInteger(DATASET_SECTION+'Albums','DataSetType',0);
        WriteString(DATASET_SECTION+'Albums','TableName','albums');
        WriteString(DATASET_SECTION+'Albums','PrivateDir',OSTempDirectory);
        WriteString(DATASET_SECTION+'Albums','DatabaseName',IncludeTrailingBackslash(GetDocumentsDirectory)+'cdcollector\data');
        { Create tracks dataset }
        WriteInteger(DATASET_SECTION+'Tracks','EngineType',1);
        WriteString(DATASET_SECTION+'Tracks','Description','Tracks Dataset
for CD Collector Audio Plugin Example Project');
        WriteInteger(DATASET_SECTION+'Tracks','DataSetType',1);
        WriteString(DATASET_SECTION+'Tracks','SQL','SELECT * FROM
Tracks<#CR#><#LF#>WHERE AlbumNo={AlbumNo=1}<#CR#><#LF#>');
        WriteString(DATASET_SECTION+'Tracks','BaseTableName','tracks');
        WriteString(DATASET_SECTION+'Tracks','PrivateDir',OSTempDirectory);
        WriteString(DATASET_SECTION+'Tracks','DatabaseName',IncludeTrailingBackslash(GetDocumentsDirectory)+'cdcollector\data');

        { Create slideshow dataset }
        WriteInteger(DATASET_SECTION+'Slideshow','EngineType',1);
        WriteString(DATASET_SECTION+'Slideshow','Description','Slideshow
DataSet for Slideshow Example Project');
        WriteInteger(DATASET_SECTION+'Slideshow','DataSetType',0);
        WriteString(DATASET_SECTION+'Slideshow','TableName','slideshow');
        WriteString(DATASET_SECTION+'Slideshow','PrivateDir',OSTempDirectory);
        WriteString(DATASET_SECTION+'Slideshow','DatabaseName',IncludeTrailingBackslash(GetDocumentsDirectory)+'slideshow\data');

        UpdateFile;
        end;
  finally
     FreeAndNil(TempIniFile);
  end;
  {$WARN SYMBOL_PLATFORM ON}
end;

There's some bits missing for the documents directory, etc., but you'll
probably do something different there anyways.  Also, the <#CR#><#LF#>
construct is necessary for representing CRLF pairs in the .ini file, so use
that if you want multiple lines for queries, descriptions, etc.

If you have any other questions, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Mar 20 2014 5:32 AMPermanent Link

David Darlison

"Tim Young [Elevate Software]" wrote:

<<If you have any other questions, please let me know.>>

This forum is excellent thanks all!

David
Image