Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Upgrade old version 3 to 4.00
Sun, Apr 19 2009 10:00 AMPermanent Link

Lars
Hi

Have following code in my program to check if the table is in different version

db_version := '4.00';
if DBISAMTable1.VersionNum <> db_version then begin
 DBISAMTable1.Close;
 DBISAMTable1.UpgradeTable;
end;

But when im running the application windows says that application has stopped working when it  comes to upgradetable function.
Without the upgradetable it runs well. But want to upgradetable for users that runs the older application with older table.
Sun, Apr 19 2009 2:25 PMPermanent Link

Lars
Lars wrote:

Hi

Have following code in my program to check if the table is in different version

db_version := '4.00';
if DBISAMTable1.VersionNum <> db_version then begin
 DBISAMTable1.Close;
 DBISAMTable1.UpgradeTable;
end;

But when im running the application windows says that application has stopped working when it  comes to upgradetable function.
Without the upgradetable it runs well. But want to upgradetable for users that runs the older application with older table.

The error is
Error # 12035 Table is not the correct version
Sun, Apr 19 2009 3:52 PMPermanent Link

Ralf Graap
Hey Lars,

i use this procedure before i open any table or query.
It works very fine for me.

Ralf


procedure DBISAMUpgradeAllTables(aDB: TDBISAMDatabase;
  aOnProgress: dbisamtb.TSteppedProgressEvent = nil;
  aOnLog: dbisamtb.TLogEvent = nil);
var
  StL    : TStringList;
  tbl    : TDBISAMTable;
  ii     : integer;
  aktVer : string;

begin
  StL := TStringList.Create;
  try
    aktVer := dbisamtb.Engine.Handle.VersionToStr(dbisamcn.VERSION_NUMBER);
    aDB.Session.GetTableNames(aDB.DatabaseName, StL);
    for ii := 0 to StL.Count - 1 do
    begin
      tbl := TDBISAMTable.Create(nil);
      try
        tbl.TableName := StL[ii];
        tbl.DatabaseName := aDB.DatabaseName;
        tbl.SessionName  := aDB.SessionName;
        tbl.OnUpgradeProgress := aOnProgress;
        tbl.OnUpgradeLog      := aOnLog;
        tbl.OnRepairProgress  := aOnProgress;
        tbl.OnRepairLog       := aOnLog;

        if tbl.VersionNum <> aktVer
        then tbl.UpgradeTable;
      finally
        FreeAndNil(tbl);
      end;
    end;
  finally
    FreeAndNil(StL);
  end;
end; { DBISAMUpgrade }




Lars schrieb:
> Lars wrote:
>
> Hi
>
> Have following code in my program to check if the table is in different version
>
>  db_version := '4.00';
>  if DBISAMTable1.VersionNum <> db_version then begin
>   DBISAMTable1.Close;
>   DBISAMTable1.UpgradeTable;
>  end;
>
> But when im running the application windows says that application has stopped working when it  comes to upgradetable function.
> Without the upgradetable it runs well. But want to upgradetable for users that runs the older application with older table.
>
> The error is
> Error # 12035 Table is not the correct version
>
Mon, Apr 20 2009 12:15 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Lars,

I suspect you are trying to open the table before you attempt to upgrade it and
the error message is generated at that time, not when you try the UpgradeTable.
Are you sure you are not trying to open the table before the upgrade?

--
Fernando Dias
[Team Elevate]
Image