Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 27 total
Thread Error #1101 in ElevateDB Manager
Tue, Dec 11 2007 4:49 AMPermanent Link

Ronald Janse
I'm new to ElevateDB, after using dbIsam for years, but it's quite
difficult to get started.
I want to migrate a dbIsam4 database as a startingpoint, but it will not
work.
I created a database (non unicode) and then select 'Migrate database'.
It gives me an error then: ElevateDB Error #1101 An error occurred with
the parameter D.
What's wrong? I'm using 1.06 b1.
Tue, Dec 11 2007 5:20 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ronald

Did you set the database directory & password?


Roy Lambert
Tue, Dec 11 2007 5:57 AMPermanent Link

Ronald Janse
Roy Lambert wrote:
> Ronald
>
> Did you set the database directory & password?
>
>
> Roy Lambert
>
I did. Anyway, an error like this is not what I expect if i do this....
I must say it is extremely difficult for a newby to get this working.
I really get lost in all the configuration / pathsetting / directory humbug.
I try to get things working with either the dbmanager or with code, but
both do not work. I only follow the lead in the manual, but then things
are missing which I have to fill in myself and they are probably not
correct.

I tried doing it with code.
I did this:
- drop a TEDBSEssion and a TEDBdatabase component on a form
- copy code from the manual:

EDBSession1.Execute('CREATE MIGRATOR "DBISAM4" MODULE edbmigratedbisam4"'+
'DESCRIPTION ''DBISAM 4 Migrator''');
EDBSession1.Execute('CREATE DATABASE Rep PATH ''Z:\Rep''');
  EDBDatabase1.DatabaseName:='Rep';
  EDBDatabase1.Database:='Rep';
  EDBDatabase1.Execute('MIGRATE DATABASE FROM "DBISAM4" USING
DatabaseDirectory = ''Z:\Rep'' WITH DATA');

After several tries (one has to know that LoginUser and LoginPassword
are Administrator and EDBDefault I get the error
'ElevateDB Error #400 The Migrator DBISAM4 already exists'
I then remove the edbmigratedbisam4.dll from the directory of my
program, because it obviously must not be there. I then get the error
'ElevateDB Error #401 The module edbmigratedbisam4' does not exist.....

I am very very lost now....
Please tell me what i should do as a general rule to convert database X
from dbIsam to ElevateDB.....
Tue, Dec 11 2007 6:47 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ronald


Drop an engine, a session and a database component on your form

set the session user/password

My conversion routine is below - its part of a much more complex overall conversion as part of a major app rewrite.

A few pointers

In EDBManager the steps are

1. create a new database to accept the converted data
2 from "within" that database select the migrate option
3 when you're setting the database path make sure you click "set parameter value" so that the SOURCE database directory is shown in the listbox

That's as much as I've needed to do

I agree with you that the transition from DBISAM to ElevateDB isn't as easy as I would have liked, and it took me a while to get my head round some of the concepts.

One of the biggest differences is the existence of system tables so if you look at what you posted

EDBSession1.Execute('CREATE MIGRATOR "DBISAM4" MODULE edbmigratedbisam4"'+
'DESCRIPTION ''DBISAM 4 Migrator''');

Creates an entry for the migrator in the system tables. Next time you run the code its already there so you don't need to run it - confusing I know but once you understand what's happening quite simple.

What I do, as you can see below is with EDBSession do Execute('DROP MIGRATOR "DBISAM4"'); which gets rid of the migrator from the system tables. Later when this is sent to customers I'll also delete the dll which IS needed in the same directory as the config.

Roy Lambert


procedure TForm1.ConvertToElevateDB;
var
Path: string;
procedure FilesToDelete(ACurDir, fnMask: string);
var
 SearchRec: TSearchRec;
 iRet: Integer;
 Cntr: integer;
begin
 glProgress1.Caption := 'Deleting old files .. [%d%%]';
 glProgress1.Percent := 0;
 Cntr := 0;
 if ACurDir[Length(ACurDir)] <> '\' then ACurDir := ACurDir + '\';
 iRet := FindFirst(ACurDir + fnMask, faAnyFile, SearchRec);
 while iRet = 0 do begin
  if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then begin
   inc(Cntr);
   glProgress1.Percent := Min(100, Cntr);
   glProgress1.Update;
   DeleteFile(ACurDir + SearchRec.Name);
  end;
  iRet := FindNext(SearchRec);
 end;
 FindClose(SearchRec);
end;
begin
Path := IncludeTrailingBackslash(ExtractFilePath(Application.ExeName));
if FileExists(Path + 'edbmigratedbisam4.dll') then begin
 glProgress1.Visible := True;
 Memo1.Lines.Add('Converting to ElevateDB database format');
 Memo1.Update;

 FilesToDelete(TfRLive, '*.EDB???'); // EDBTbl, EDBIdx, EDBblb
 if FileExists(Path + 'EDBConfig.EDBLog') then DeleteFile(Path + 'EDBConfig.EDBLog');
 if FileExists(Path + 'EDBConfig.EDBCfg.Old') then DeleteFile(Path + 'EDBConfig.EDBCfg.Old');
 if FileExists(Path + 'EDBConfig.EDBCfg') then DeleteFile(Path + 'EDBConfig.EDBCfg');
 if FileExists(Path + 'EDBConfig.EDBLck') then DeleteFile(Path + 'EDBConfig.EDBLck');
 with EDBSession do begin
  Execute('CREATE MIGRATOR "DBISAM4" MODULE "edbmigratedbisam4" DESCRIPTION ''DBISAM 4 Migrator''');
  Execute('CREATE DATABASE ' + CompanyCode.Text + ' PATH ' + QuotedStr(TfRLive));
 end;
 with EDBDataBase do begin
  DatabaseName := CompanyCode.Text;
  Database := CompanyCode.Text;
  Execute('MIGRATE DATABASE FROM "DBISAM4" USING DatabaseDirectory = ' + QuotedStr(TfRLive) + 'WITH DATA');
 end;
 with EDBSession do Execute('DROP MIGRATOR "DBISAM4"');
 FilesToDelete(TfRLive, '*.dat');
 FilesToDelete(TfRLive, '*.idx');
 FilesToDelete(TfRLive, '*.blb');
end else MessageDlg('migrator code is missing', mtError, [mbOK], 0);
end;
Tue, Dec 11 2007 8:17 AMPermanent Link

Ronald Janse
Roy,

Thanks very much for your support!
After a few tries and adding some 'drop' statements (to get rid of the
database again and angain), I managed to get it to run. I still can't
grasp the idea of elevatedb, but it seems to start, there is only one
error left, I can't get rid of:

#401: The parameter DatabaseDirectory does not exist

The manual does not go in to that either.
Hope you can shine a light on that as well....

Thanks,

Ronald Janse

Roy Lambert wrote:
> Ronald
>
>
> Drop an engine, a session and a database component on your form
>
> set the session user/password
>
> My conversion routine is below - its part of a much more complex overall conversion as part of a major app rewrite.
>
> A few pointers
>
> In EDBManager the steps are
>
> 1. create a new database to accept the converted data
> 2 from "within" that database select the migrate option
> 3 when you're setting the database path make sure you click "set parameter value" so that the SOURCE database directory is shown in the listbox
>
> That's as much as I've needed to do
>
> I agree with you that the transition from DBISAM to ElevateDB isn't as easy as I would have liked, and it took me a while to get my head round some of the concepts.
>
> One of the biggest differences is the existence of system tables so if you look at what you posted
>
> EDBSession1.Execute('CREATE MIGRATOR "DBISAM4" MODULE edbmigratedbisam4"'+
> 'DESCRIPTION ''DBISAM 4 Migrator''');
>
> Creates an entry for the migrator in the system tables. Next time you run the code its already there so you don't need to run it - confusing I know but once you understand what's happening quite simple.
>
> What I do, as you can see below is with EDBSession do Execute('DROP MIGRATOR "DBISAM4"'); which gets rid of the migrator from the system tables. Later when this is sent to customers I'll also delete the dll which IS needed in the same directory as the config.
>
> Roy Lambert
>
>
> procedure TForm1.ConvertToElevateDB;
> var
> Path: string;
> procedure FilesToDelete(ACurDir, fnMask: string);
> var
>   SearchRec: TSearchRec;
>   iRet: Integer;
>   Cntr: integer;
> begin
>   glProgress1.Caption := 'Deleting old files .. [%d%%]';
>   glProgress1.Percent := 0;
>   Cntr := 0;
>   if ACurDir[Length(ACurDir)] <> '\' then ACurDir := ACurDir + '\';
>   iRet := FindFirst(ACurDir + fnMask, faAnyFile, SearchRec);
>   while iRet = 0 do begin
>    if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then begin
>     inc(Cntr);
>     glProgress1.Percent := Min(100, Cntr);
>     glProgress1.Update;
>     DeleteFile(ACurDir + SearchRec.Name);
>    end;
>    iRet := FindNext(SearchRec);
>   end;
>   FindClose(SearchRec);
> end;
> begin
> Path := IncludeTrailingBackslash(ExtractFilePath(Application.ExeName));
> if FileExists(Path + 'edbmigratedbisam4.dll') then begin
>   glProgress1.Visible := True;
>   Memo1.Lines.Add('Converting to ElevateDB database format');
>   Memo1.Update;
>
>   FilesToDelete(TfRLive, '*.EDB???'); // EDBTbl, EDBIdx, EDBblb
>   if FileExists(Path + 'EDBConfig.EDBLog') then DeleteFile(Path + 'EDBConfig.EDBLog');
>   if FileExists(Path + 'EDBConfig.EDBCfg.Old') then DeleteFile(Path + 'EDBConfig.EDBCfg.Old');
>   if FileExists(Path + 'EDBConfig.EDBCfg') then DeleteFile(Path + 'EDBConfig.EDBCfg');
>   if FileExists(Path + 'EDBConfig.EDBLck') then DeleteFile(Path + 'EDBConfig.EDBLck');
>   with EDBSession do begin
>    Execute('CREATE MIGRATOR "DBISAM4" MODULE "edbmigratedbisam4" DESCRIPTION ''DBISAM 4 Migrator''');
>    Execute('CREATE DATABASE ' + CompanyCode.Text + ' PATH ' + QuotedStr(TfRLive));
>   end;
>   with EDBDataBase do begin
>    DatabaseName := CompanyCode.Text;
>    Database := CompanyCode.Text;
>    Execute('MIGRATE DATABASE FROM "DBISAM4" USING DatabaseDirectory = ' + QuotedStr(TfRLive) + 'WITH DATA');
>   end;
>   with EDBSession do Execute('DROP MIGRATOR "DBISAM4"');
>   FilesToDelete(TfRLive, '*.dat');
>   FilesToDelete(TfRLive, '*.idx');
>   FilesToDelete(TfRLive, '*.blb');
> end else MessageDlg('migrator code is missing', mtError, [mbOK], 0);
> end;
Tue, Dec 11 2007 8:57 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ronald


It sounds as though you're giving a non valid directory as the location of the source database. Post the full code of the unit you're using for migration and I'll have a look at it. If you prefer to email directly use the email address this is sent from.

Roy Lambert
Tue, Dec 11 2007 9:37 AMPermanent Link

Ronald Janse
Hi Roy,

This is the code. I changed it a little, because I did not have your
third party stuff.
Thanks again for your input!

procedure TForm1.BtnMigreerClick(Sender: TObject);
var
  Path, cdBIsamPath: string;

  procedure FilesToDelete(ACurDir, fnMask: string);
  var
    SearchRec: TSearchRec;
    iRet: Integer;
    Cntr: integer;
  begin
    //Progress.Caption := 'Deleting old files .. [%d%%]';
    //Progress.Percent := 0;
    Cntr := 0;
    if ACurDir[Length(ACurDir)] <> '\' then ACurDir := ACurDir + '\';
    iRet := FindFirst(ACurDir + fnMask, faAnyFile, SearchRec);
    while iRet = 0 do begin
     if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then begin
      inc(Cntr);

      //glProgress1.Percent := Min(100, Cntr);
      //glProgress1.Update;
      DeleteFile(ACurDir + SearchRec.Name);
     end;
     iRet := FindNext(SearchRec);
    end;
    FindClose(SearchRec);
  end;

begin
  Path :='c:\elevatedb\';
  cDBisamPath :='c:\db\';
  if FileExists(Path + 'edbmigratedbisam4.dll') then begin
    Memo1.Lines.Add('Converting to ElevateDB database format');
    Memo1.Update;

    FilesToDelete(cDbIsamPath, '*.EDB???'); // EDBTbl, EDBIdx, EDBblb
    if FileExists(Path + 'EDBConfig.EDBLog') then DeleteFile(Path +
'EDBConfig.EDBLog');
    if FileExists(Path + 'EDBConfig.EDBCfg.Old') then DeleteFile(Path +
'EDBConfig.EDBCfg.Old');
    if FileExists(Path + 'EDBConfig.EDBCfg') then DeleteFile(Path +
'EDBConfig.EDBCfg');
    if FileExists(Path + 'EDBConfig.EDBLck') then DeleteFile(Path +
'EDBConfig.EDBLck');
    //with EDBSession1 do Execute('DROP MIGRATOR "DBISAM4"');
    //with EDBSession1 do Execute('DROP DATABASE "TEST"');
    with EDBSession1 do
    begin
      Execute('CREATE MIGRATOR "DBISAM4" MODULE "edbmigratedbisam4"
DESCRIPTION ''DBISAM 4 Migrator''');
      Execute('CREATE DATABASE ' + 'TEST' + ' PATH ' +
QuotedStr(cDbIsamPath));
    end;
    with EDBDataBase1 do
    begin
      DatabaseName := 'Test';
      Database := 'Test';
      Execute('MIGRATE DATABASE FROM "DBISAM4" USING DatabaseDirectory
= ' + QuotedStr(cDbIsamPath) + ' WITH DATA');
    end;
    with EDBSession1 do Execute('DROP MIGRATOR "DBISAM4"');
    //FilesToDelete(cDbIsamPath, '*.dat');
    //FilesToDelete(cDbIsamPath, '*.idx');
    //FilesToDelete(cDbIsamPath, '*.blb');
  end
  else MessageDlg('migrator code is missing', mtError, [mbOK], 0);
end;

Roy Lambert wrote:
> Ronald
>
>
> It sounds as though you're giving a non valid directory as the location of the source database. Post the full code of the unit you're using for migration and I'll have a look at it. If you prefer to email directly use the email address this is sent from.
>
> Roy Lambert
>
Tue, Dec 11 2007 9:41 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ronald,

<< I'm new to ElevateDB, after using dbIsam for years, but it's quite
difficult to get started.
I want to migrate a dbIsam4 database as a startingpoint, but it will not
work.
I created a database (non unicode) and then select 'Migrate database'. It
gives me an error then: ElevateDB Error #1101 An error occurred with the
parameter D.
What's wrong? I'm using 1.06 b1. >>

Are you sure that the error code is 1101 ?  That is the error for a client
connection being lost.  I suspect that the error code you're seeing is 1011,
which is the error code for an invalid value being assigned to a parameter
or column.  What is the database directory that you're using for the migrate
?

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Dec 11 2007 9:54 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ronald,

<< I really get lost in all the configuration / pathsetting / directory
humbug. >>

There's only two settings to remember - the configuration file path and the
database path definition. The rest is exactly the same as DBISAM in terms of
configuration.

<< I try to get things working with either the dbmanager or with code, but
both do not work. >>

What is not working in the ElevateDB Manager ?  (besides the migrate issue
that you're having, which is most likely just an incorrect or odd database
directory value)

<< I only follow the lead in the manual, but then things are missing which I
have to fill in myself and they are probably not correct. >>

What is missing in the manual ?  As far as I know the tutorials are
perfectly fine.

<< I tried doing it with code.
I did this:
- drop a TEDBSEssion and a TEDBdatabase component on a form >>

You aren't following the tutorial.  The tutorial first says to drop a
TEDBEngine component on the form:

http://www.elevatesoft.com/edb1d7_loc_application_tutorial.htm

<< - copy code from the manual:

EDBSession1.Execute('CREATE MIGRATOR "DBISAM4" MODULE edbmigratedbisam4"'+
'DESCRIPTION ''DBISAM 4 Migrator''');
EDBSession1.Execute('CREATE DATABASE Rep PATH ''Z:\Rep''');
  EDBDatabase1.DatabaseName:='Rep';
  EDBDatabase1.Database:='Rep';
  EDBDatabase1.Execute('MIGRATE DATABASE FROM "DBISAM4" USING
DatabaseDirectory = ''Z:\Rep'' WITH DATA'); >>

That's not the code from the manual tutorial.  You're mixing the migration
in also, and that is a little more advanced.  Initially, you should just use
the ElevateDB Manager for performing the initial migration so that you can
work interactively with the migrated database via the tutorials.  Once
you're comfortable with a basic application, then you can move on to dealing
with the migration.

<< After several tries (one has to know that LoginUser and LoginPassword are
Administrator and EDBDefault >>

This is mentioned right in the same tutorial linke to above.  They're in
bold letters also.

<< I get the error
'ElevateDB Error #400 The Migrator DBISAM4 already exists' I then remove
the edbmigratedbisam4.dll from the directory of my program, because it
obviously must not be there. I then get the error 'ElevateDB Error #401 The
module edbmigratedbisam4' does not exist..... >>

The migrator modules themselves (.dlls) are separate from the migrator
*definitions* in the Configuration database.  Both must exist in order to
use the migration features, and you cannot attempt to create the migrator a
second time once it has been created.  You have to query the Configuration
database first to find out if the migrator already exists, or put the
creation of the migration in a try..except block to suppress any exception.

This is the code we use in the EDB Manager:

procedure TSessionObject.CreateMigrator(const MigratorName: TEDBString;
                                       const MigratorDesc: TEDBString;
                                       const ModuleName: TEDBString);
var
  TempFound: Boolean;
begin
  with MainForm.SystemDatabaseQuery do
     begin
     SessionName:=FSession.SessionName;
     DatabaseName:=CONFIG_DB_NAME;
     SQL.Clear;
     SQL.Add('SELECT * FROM Migrators');
     SQL.Add('WHERE Name='+QuotedString(MigratorName,''''));
     RequestSensitive:=True;
     RemoteReadSize:=1;
     Open;
     try
        if (RecordCount=0) then
           begin
           with MainForm.SystemDatabaseObjectsQuery do
              begin
              SessionName:=FSession.SessionName;
              DatabaseName:=CONFIG_DB_NAME;
              SQL.Clear;
              SQL.Add('SELECT * FROM Modules');
              SQL.Add('WHERE Name='+QuotedString(ModuleName,''''));
              RequestSensitive:=True;
              RemoteReadSize:=1;
              Open;
              TempFound:=(RecordCount=1);
              Close;
              if TempFound then
                 begin
                 SQL.Clear;
                 SQL.Add('CREATE MIGRATOR
'+QuotedString(MigratorName,'"'));
                 SQL.Add('MODULE '+QuotedString(ModuleName,'"'));
                 SQL.Add('DESCRIPTION '+QuotedString(MigratorDesc,''''));
                 ExecSQL;
                 end;
              end;
           end;
     finally
        Close;
     end;
     end;
end;

See these links for more information:

http://www.elevatesoft.com/edb1sql_configuration_database.htm
http://www.elevatesoft.com/edb1sql_migrating_databases.htm
http://www.elevatesoft.com/edb1d7_creating_configuration_objects.htm
http://www.elevatesoft.com/edb1d7_querying_configuration_objects.htm

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Dec 11 2007 9:58 AMPermanent Link

Ronald Janse
Tim,

You're right, it's error code 1011. Sorry about that...
The database directory is called
Z:\Repond\Repond 7\Test elevateDB\data Repond7
it is empty, except for the edbmigratedbisam4.dll...

Tim Young [Elevate Software] wrote:
> Ronald,
>
> << I'm new to ElevateDB, after using dbIsam for years, but it's quite
> difficult to get started.
>  I want to migrate a dbIsam4 database as a startingpoint, but it will not
> work.
>  I created a database (non unicode) and then select 'Migrate database'. It
> gives me an error then: ElevateDB Error #1101 An error occurred with the
> parameter D.
>  What's wrong? I'm using 1.06 b1. >>
>
> Are you sure that the error code is 1101 ?  That is the error for a client
> connection being lost.  I suspect that the error code you're seeing is 1011,
> which is the error code for an invalid value being assigned to a parameter
> or column.  What is the database directory that you're using for the migrate
> ?
>
Page 1 of 3Next Page »
Jump to Page:  1 2 3
Image