Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 10 total
Thread ElevateDB and Deployment
Fri, Mar 26 2010 3:26 AMPermanent Link

Edwin Lau

I have been evaluating ElevateDB since the announcement of the migration
offer from DBISAM. There is a lot of changes involved and it took me a
while to understand some of the concepts.

A little background here. I develop shareware applications and as such
it would be difficult to determine my clients' technical know-how and
how the applications would be deployed. Now to make matters worst, we
got the headache of the UAC introduced in Windows Vista and Windows 7 so
gone are the days where I could just place the database files in the
Program Files folder and get it to work. The next option would be to
place all database files into the Application Data folder which means
they would inevitably be different from one computer to another.

With DBISAM, I just need to query where the Application Data Folder is,
change a few parameters and I am all set. That however is not the case
with ElevateDB. It took me a while to get around the concept of the
Configuration File. I understand that the Database Path is embedded in
this Configuration File which does not seems to be quite easily updated.
How do I go about changing it on the fly so that I can ensure it would
work every single time ? Can all these be done virtually so as to cater
so that the program can run off a CD-ROM.

DBISAM is perfect for me and the only thing that it lacks is the Unicode
support. ElevateDB on the other hand supports Unicode but it seems a
little difficult for me to understand and deploy.

If there is a quick way of getting around the deployment issue, I would
be a believer too.

Thanks.

Edwin
Fri, Mar 26 2010 4:40 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Edwin


Altering the location of the database is trivial. One piece of SQL:

ALTER DATABASE "RLDemo"
PATH 'E:\TextSearch Problem\'

The problem starts with the configuration file. That's also fairly simple since its just setting a property in the engine (or session if you use session settings rather than engine settings).

To me the big problem is "where can I put my data?" As you say Windows has changed the rules. As I see it you have two choices 1) do what Windows wants or 2) ignore Windows and create your own directory scheme outside of theirs.

If you adopt option 1 then there are lots of posts on the CodeGear newsgroups showing how to get the allowed directories (and which they are). If you use option 2 (my choice) then its dead easy Smiley

As I understand it in either case the programs can still go in ProgramFiles but anything that might be changed (configuration, catalog, tables) can't.

Once you get over the confusion between configuration and catalog files and not just being able to set a directory for the table location its simple.

Roy Lambert [Team Elevate]
Fri, Mar 26 2010 5:50 AMPermanent Link

Edwin Lau

Roy

Thanks for your reply. It does sounds simple.

For the test, I moved the db folder to c:\newpath\ and then did the
following. However, the program does not seems to want to run at all.

procedure TForm6.EDBEngine1BeforeStart(Sender: TObject);
begin

EDBQuery1.SQL.Clear;
EDBQuery1.SQL.Text := 'ALTER DATABASE "phonebook"  '+
'PATH '+engine.quotedsqlstr('c:\newpath\');
edbquery1.ExecSQL;

end;

procedure TForm6.FormCreate(Sender: TObject);
begin
EDBTable1.Active := true;
end;

Here is my dfm

object Form6: TForm6
  Left = 0
  Top = 0
  Caption = 'Form6'
  ClientHeight = 368
  ClientWidth = 750
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object DBGrid1: TDBGrid
    Left = 88
    Top = 24
    Width = 649
    Height = 257
    DataSource = DataSource1
    TabOrder = 0
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -11
    TitleFont.Name = 'Tahoma'
    TitleFont.Style = []
  end
  object DBNavigator1: TDBNavigator
    Left = 288
    Top = 296
    Width = 240
    Height = 25
    DataSource = DataSource1
    TabOrder = 1
  end
  object EDBEngine1: TEDBEngine
    EngineType = etClient
    Signature = 'edb_signature'
    EncryptionPassword = 'elevatesoft'
    LargeFileSupport = True
    ExclusiveFileAccess = False
    LicensedSessions = 4096
    ConfigPath = 'C:\Elevatedb test'
    ConfigName = 'testfile'
    ConfigExtension = '.EDBCfg'
    LockExtension = '.EDBLck'
    LogExtension = '.EDBLog'
    MaxLogFileSize = 1048576
    LogCategories = [lcInformation, lcWarning, lcError]
    CatalogName = 'EDBDatabase'
    CatalogExtension = '.EDBCat'
    BackupExtension = '.EDBBkp'
    UpdateExtension = '.EDBUpd'
    TableExtension = '.EDBTbl'
    TableIndexExtension = '.EDBIdx'
    TableBlobExtension = '.EDBBlb'
    TablePublishExtension = '.EDBPbl'
    TempTablesPath = 'C:\Users\edacer7\AppData\Local\Temp\'
    ServerName = 'EDBSrvr'
    ServerDescription = 'ElevateDB Server'
    ServerAuthorizedAddresses.Strings = (
      '*')
    BeforeStart = EDBEngine1BeforeStart
    Left = 32
    Top = 24
  end
  object EDBSession2: TEDBSession
    LoginUser = 'Administrator'
    LoginPassword = 'EDBDefault'
    SessionName = 'Test'
    LocalSignature = 'edb_signature'
    LocalEncryptionPassword = 'elevatesoft'
    LocalLargeFileSupport = True
    LocalConfigPath = 'C:\Elevatedb test'
    LocalConfigName = 'testfile'
    LocalConfigExtension = '.EDBCfg'
    LocalLockExtension = '.EDBLck'
    LocalLogExtension = '.EDBLog'
    LocalMaxLogFileSize = 1048576
    LocalLogCategories = [lcInformation, lcWarning, lcError]
    LocalCatalogName = 'EDBDatabase'
    LocalCatalogExtension = '.EDBCat'
    LocalBackupExtension = '.EDBBkp'
    LocalUpdateExtension = '.EDBUpd'
    LocalTableExtension = '.EDBTbl'
    LocalTableIndexExtension = '.EDBIdx'
    LocalTableBlobExtension = '.EDBBlb'
    LocalTablePublishExtension = '.EDBPbl'
    LocalTempTablesPath = 'C:\Users\edacer7\AppData\Local\Temp\'
    RemoteSignature = 'edb_signature'
    RemoteEncryptionPassword = 'elevatesoft'
    RemoteAddress = '127.0.0.1'
    Left = 32
    Top = 88
  end
  object EDBDatabase1: TEDBDatabase
    DatabaseName = 'Test'
    Database = 'phonebook'
    SessionName = 'Test'
    Left = 24
    Top = 144
  end
  object EDBTable1: TEDBTable
    DatabaseName = 'Test'
    SessionName = 'Test'
    TableName = 'phonedb'
    Left = 24
    Top = 208
  end
  object DataSource1: TDataSource
    DataSet = EDBTable1
    Left = 24
    Top = 272
  end
  object EDBQuery1: TEDBQuery
    DatabaseName = 'Test'
    SessionName = 'Test'
    DataSource = DataSource1
    Params = <>
    Left = 104
    Top = 288
  end
end


Thanks.

Edwin

Roy Lambert wrote:
> Edwin
>
>
> Altering the location of the database is trivial. One piece of SQL:
>
> ALTER DATABASE "RLDemo"
> PATH 'E:\TextSearch Problem\'
>
> The problem starts with the configuration file. That's also fairly simple since its just setting a property in the engine (or session if you use session settings rather than engine settings).
>
> To me the big problem is "where can I put my data?" As you say Windows has changed the rules. As I see it you have two choices 1) do what Windows wants or 2) ignore Windows and create your own directory scheme outside of theirs.
>
> If you adopt option 1 then there are lots of posts on the CodeGear newsgroups showing how to get the allowed directories (and which they are). If you use option 2 (my choice) then its dead easy Smiley
>
> As I understand it in either case the programs can still go in ProgramFiles but anything that might be changed (configuration, catalog, tables) can't.
>
> Once you get over the confusion between configuration and catalog files and not just being able to set a directory for the table location its simple.
>
> Roy Lambert [Team Elevate]
>
Fri, Mar 26 2010 7:16 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Edwin


I'm not sure you can run any sql before you start the engine. Even if you could its at the wrong level.

ElevateDBs structure is sort of:

Engine
    Session
        Database
            Table

ALTER DATABASE needs to be at the session level to work.

Roy Lambert [Team Elevate]
Fri, Mar 26 2010 2:19 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Edwin,

<< With DBISAM, I just need to query where the Application Data Folder is,
change a few parameters and I am all set. That however is not the case with
ElevateDB. It took me a while to get around the concept of the Configuration
File. I understand that the Database Path is embedded in this Configuration
File which does not seems to be quite easily updated.  How do I go about
changing it on the fly so that I can ensure it would work every single time
? >>

Sure, just make a subdirectory for your company under the common app data
directory or the user app data directory, and under that a subdirectory for
your application, like this:

<App Data Directory>\<My Company>\<My Application>

You'll set the configuration path (TEDBEngine.ConfigPath) to this path.

Then create a subdirectory for your database:

<App Data Directory>\<My Company>\<My Application>\<Data>

And use this code:

  { Activate the engine.  The engine can be referenced by the generic
    Engine function in the edbcomps unit }
  Engine.Active:=True;
  { Now connect the default session, referened by the generic Session
     function in the edbcomps unit }
  Session.Connected:=True;
  { Check to see if the database exists or whether it needs to be
    created }
  with ConfigurationQuery do
     begin
     DatabaseName:='Configuration';
     SQL.Text:='SELECT * FROM Databases WHERE
Name='+Engine.QuotedSQLStr('MyDatabase');
     Open;
     if (RecordCount=0) then
        begin
        { Database doesn't exist and we need to create it }
        Close;
        SQL.Text:='CREATE DATABASE "MyDatabase" PATH '+
                   Engine.QuotedSQLStr(IncludeTrailingBackslash(Engine.ConfigPath)+'data');
        ExecSQL;
        end
     else if not
AnsiSameText(FieldByName('Path').AsString,IncludeTrailingBackslash(Engine.ConfigPath)+'data')
then
        begin
        { Database doesn't exist and we need to create it }
        Close;
        SQL.Text:='ALTER DATABASE "MyDatabase" PATH '+
                   Engine.QuotedSQLStr(IncludeTrailingBackslash(Engine.ConfigPath)+'data');
        ExecSQL;
        end
     else
        Close;
     end;

<< Can all these be done virtually so as to cater so that the program can
run off a CD-ROM. >>

Sure, instead of using the \data subdirectory off of the common or user app
data directory, just use the CD-ROM path instead for the database path.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Mar 26 2010 8:39 PMPermanent Link

Edwin Lau

Tim,

Thanks. That did the trick.

Correct me if I am wrong, for distribution I would need to ship the
following files

1) For Empty Tables
   - Config File (*.EDBCfg)
   - Catalog File (*.EDBCat)

2) For Tables with Data
   - Config File (*.EDBCfg)
   - Catalog File (*.EDBCat)
   - Table File (*.EDBTbl)
   - Index File (*.EDBIdx)

During the 'Alter Database' statement, the Config file did change so I
would take it that on a CD-ROM which is read-only, I would probably need
to copy the files to a readable media such as the harddisk in order for
it to work ? Of course, the Data on the CD-ROM would only be read-only
in this case.

Thanks.

Edwin

Tim Young [Elevate Software] wrote:
> Edwin,
>
> << With DBISAM, I just need to query where the Application Data Folder is,
> change a few parameters and I am all set. That however is not the case with
> ElevateDB. It took me a while to get around the concept of the Configuration
> File. I understand that the Database Path is embedded in this Configuration
> File which does not seems to be quite easily updated.  How do I go about
> changing it on the fly so that I can ensure it would work every single time
> ? >>
>
> Sure, just make a subdirectory for your company under the common app data
> directory or the user app data directory, and under that a subdirectory for
> your application, like this:
>
> <App Data Directory>\<My Company>\<My Application>
>
> You'll set the configuration path (TEDBEngine.ConfigPath) to this path.
>
> Then create a subdirectory for your database:
>
> <App Data Directory>\<My Company>\<My Application>\<Data>
>
> And use this code:
>
>    { Activate the engine.  The engine can be referenced by the generic
>      Engine function in the edbcomps unit }
>    Engine.Active:=True;
>    { Now connect the default session, referened by the generic Session
>       function in the edbcomps unit }
>    Session.Connected:=True;
>    { Check to see if the database exists or whether it needs to be
>      created }
>    with ConfigurationQuery do
>       begin
>       DatabaseName:='Configuration';
>       SQL.Text:='SELECT * FROM Databases WHERE
> Name='+Engine.QuotedSQLStr('MyDatabase');
>       Open;
>       if (RecordCount=0) then
>          begin
>          { Database doesn't exist and we need to create it }
>          Close;
>          SQL.Text:='CREATE DATABASE "MyDatabase" PATH '+
>                     Engine.QuotedSQLStr(IncludeTrailingBackslash(Engine.ConfigPath)+'data');
>          ExecSQL;
>          end
>       else if not
> AnsiSameText(FieldByName('Path').AsString,IncludeTrailingBackslash(Engine.ConfigPath)+'data')
> then
>          begin
>          { Database doesn't exist and we need to create it }
>          Close;
>          SQL.Text:='ALTER DATABASE "MyDatabase" PATH '+
>                     Engine.QuotedSQLStr(IncludeTrailingBackslash(Engine.ConfigPath)+'data');
>          ExecSQL;
>          end
>       else
>          Close;
>       end;
>
> << Can all these be done virtually so as to cater so that the program can
> run off a CD-ROM. >>
>
> Sure, instead of using the \data subdirectory off of the common or user app
> data directory, just use the CD-ROM path instead for the database path.
>
Mon, Mar 29 2010 2:49 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Edwin,

<< Correct me if I am wrong, for distribution I would need to ship the
following files >>

It really depends upon whether you want to create everything "on-the-fly" or
not.  If you want to create everything at runtime, then you don't need to
ship anything except for the database contents on the CD-ROM, which would be
the table/index/BLOB/published updates files (last two are optional) and the
database catalog file.

<< During the 'Alter Database' statement, the Config file did change so I
would take it that on a CD-ROM which is read-only, I would probably need to
copy the files to a readable media such as the harddisk in order for it to
work ? >>

Yes.  However, the easiest way would be to skip shipping the configuration
file with your product and just let EDB create one in the configuration path
for you when you connect the session for the first time.  Then you can make
some quick adjustments to the configuration for any user security
modifications (CREATE/ALTER USER/ROLE) and the database creation for the
database on the CD-ROM (CREATE/ALTER DATABASE).

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, May 3 2010 9:53 PMPermanent Link

Gregory Sebastian

Hi Tim,
<<<
App Data Directory>\<My Company>\<My Application>
You'll set the configuration path (TEDBEngine.ConfigPath) to this path.
>>

Is this technique for the config path also applicable when apps (local
sessions) in a multi-user LAN enviroment are opening the same db on a shared
network folder ? I remember reading somewhere that the Config file is also
used for locking purposes and that all apps in a LAN must point to the same
physical file.

regards
Gregory Sebastian


"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:2CC871C3-7C30-44E4-8F11-9E923DB8D441@news.elevatesoft.com...
> Edwin,
>
> << With DBISAM, I just need to query where the Application Data Folder is,
> change a few parameters and I am all set. That however is not the case
> with ElevateDB. It took me a while to get around the concept of the
> Configuration File. I understand that the Database Path is embedded in
> this Configuration File which does not seems to be quite easily updated.
> How do I go about changing it on the fly so that I can ensure it would
> work every single time ? >>
>
> Sure, just make a subdirectory for your company under the common app data
> directory or the user app data directory, and under that a subdirectory
> for your application, like this:
>
> <App Data Directory>\<My Company>\<My Application>
>
> You'll set the configuration path (TEDBEngine.ConfigPath) to this path.
>
> Then create a subdirectory for your database:
>
> <App Data Directory>\<My Company>\<My Application>\<Data>
>
> And use this code:
>
>   { Activate the engine.  The engine can be referenced by the generic
>     Engine function in the edbcomps unit }
>   Engine.Active:=True;
>   { Now connect the default session, referened by the generic Session
>      function in the edbcomps unit }
>   Session.Connected:=True;
>   { Check to see if the database exists or whether it needs to be
>     created }
>   with ConfigurationQuery do
>      begin
>      DatabaseName:='Configuration';
>      SQL.Text:='SELECT * FROM Databases WHERE
> Name='+Engine.QuotedSQLStr('MyDatabase');
>      Open;
>      if (RecordCount=0) then
>         begin
>         { Database doesn't exist and we need to create it }
>         Close;
>         SQL.Text:='CREATE DATABASE "MyDatabase" PATH '+
>
> Engine.QuotedSQLStr(IncludeTrailingBackslash(Engine.ConfigPath)+'data');
>         ExecSQL;
>         end
>      else if not
> AnsiSameText(FieldByName('Path').AsString,IncludeTrailingBackslash(Engine.ConfigPath)+'data')
> then
>         begin
>         { Database doesn't exist and we need to create it }
>         Close;
>         SQL.Text:='ALTER DATABASE "MyDatabase" PATH '+
>
> Engine.QuotedSQLStr(IncludeTrailingBackslash(Engine.ConfigPath)+'data');
>         ExecSQL;
>         end
>      else
>         Close;
>      end;
>
> << Can all these be done virtually so as to cater so that the program can
> run off a CD-ROM. >>
>
> Sure, instead of using the \data subdirectory off of the common or user
> app data directory, just use the CD-ROM path instead for the database
> path.
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
Tue, May 4 2010 1:53 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Gregory,

<< Is this technique for the config path also applicable when apps (local
sessions) in a multi-user LAN enviroment are opening the same db on a shared
network folder ? I remember reading somewhere that the Config file is also
used for locking purposes and that all apps in a LAN must point to the same
physical file. >>

No, in that case you'll want to use a proper shared folder on a common
server share.  Also, be sure to define all database paths as UNC, and not
using mapped drives, unless you can be assured that all users are using the
same mapped drive letters and directory paths.

--
Tim Young
Elevate Software
www.elevatesoft.com
Tue, May 4 2010 8:23 PMPermanent Link

Gregory Sebastian

Thanks Tim, got it.

cheers
Gregory Sebastian


"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:678F98A9-AB8B-4933-80F8-9462E29FEA6D@news.elevatesoft.com...
> Gregory,
>
> << Is this technique for the config path also applicable when apps (local
> sessions) in a multi-user LAN enviroment are opening the same db on a
> shared network folder ? I remember reading somewhere that the Config file
> is also used for locking purposes and that all apps in a LAN must point to
> the same physical file. >>
>
> No, in that case you'll want to use a proper shared folder on a common
> server share.  Also, be sure to define all database paths as UNC, and not
> using mapped drives, unless you can be assured that all users are using
> the same mapped drive letters and directory paths.
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
Image