Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Upgrading from (god knows what version) DBisam
Tue, Jan 13 2015 10:30 AMPermanent Link

Paul L

Samu Games

We have bought out an old company and all source codes, problem is there missing modules (blah blah)

Ive remade some them but hit a small wall, It uses the Dbisam which id imangine was round 1998-2001
Now since i cant find these old versions can any help me with the following >

procedure SetTableBlobSize(table:TDBISAMTable; blobSize:integer);
  begin
  with table do
     begin
     Active:=false;
     RestructureFieldDefs.Update;
     RestructureIndexDefs.Update;
     RestructureTable(0,0,UserMajorVersion,UserMinorVersion,false,'','',blobSize,-1,true);
     end;
  end;


I tried putting it tot he following

(99)     TDBISAMFieldDefs.Update;
(100)     TDBISAMIndexDefs.Update;
(101)      AlterTable(0,0,UserMajorVersion,UserMinorVersion,false,'','',blobSize,-1,true);


and get the following error >

[Error] DRMUtilDBISAM.pas(99): This form of method call only allowed for class methods
[Error] DRMUtilDBISAM.pas(100): This form of method call only allowed for class methods
[Error] DRMUtilDBISAM.pas(101): Incompatible types: 'Boolean' and 'Word'
[Error] DRMUtilDBISAM.pas(101): Incompatible types: 'Integer' and 'String'
[Error] DRMUtilDBISAM.pas(101): Incompatible types: 'String' and 'Boolean'

I know im doing a stupid thing but been trying to redo this project for over 2 months now

Cheers Paul
Tue, Jan 13 2015 10:37 AMPermanent Link

Paul L

Samu Games

ps Delphi 6
Tue, Jan 13 2015 11:09 AMPermanent Link

Matthew Jones

Paul L wrote:

> procedure SetTableBlobSize(table:TDBISAMTable; blobSize:integer);
>    begin
>    with table do
>       begin
>       Active:=false;
>       RestructureFieldDefs.Update;
>       RestructureIndexDefs.Update;
>
> RestructureTable(0,0,UserMajorVersion,UserMinorVersion,false,'','',blo
> bSize,-1,true);       end;    end;
>
>
> I tried putting it tot he following
>
>  (99)     TDBISAMFieldDefs.Update;
>  (100)     TDBISAMIndexDefs.Update;
> (101)
> AlterTable(0,0,UserMajorVersion,UserMinorVersion,false,'','',blobSize,
> -1,true);

The first part looks fine to me. I would presume this is on a form or
datamodule with a DBISAM Table called RestructureTable, which then has
the field and index definitions as objects too. I'd have to think about
the actual details, but you have gone in the wrong direction.

Anyway, this is extracted from my working code, which might give you a
nudge?

   tableChecker.Active := False;
   tableChecker.TableName := szDbName;
   tableChecker.IndexDefs.Update;

   tableChecker.FieldDefs.Updated := false;
   tableChecker.FieldDefs.Update;

   tableChecker.FieldDefs.Add(szFieldName, ftType, nFieldLength, false,
'', '', '', '');

   tableChecker.AlterTable(0, 0, 2, True, GetTablePass, 'DatabaseFile',
1024, 1024);

--

Matthew Jones
Tue, Jan 13 2015 11:32 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Paul


>I tried putting it tot he following
>
> (99) TDBISAMFieldDefs.Update;
> (100) TDBISAMIndexDefs.Update;
>(101) AlterTable(0,0,UserMajorVersion,UserMinorVersion,false,'','',blobSize,-1,true);

I may be completely misunderstanding but it looks as though you're trying to call the class methods directly on the type rather than on an instance of the class.

These days I use ElevateDB so I'm not upto date, but looking at the manual all you should have needed to do is alter RestructureTable to AlterTable

This <<Now since i cant find these old versions>> has me slightly baffled. Where have you looked? Older versions aren't generally for sale but if you need them ElevateSoft are generally sympathetic and will sell you the older version, you can also upgrade fairly easily (DBSys will update your tables).

Final little thought is that with the more modern versions of DBISAM the restructuring can be done by SQL rather than table methods.

Roy Lambert
Tue, Jan 13 2015 12:12 PMPermanent Link

Raul

Team Elevate Team Elevate

On 1/13/2015 10:30 AM, Paul L wrote:
> Ive remade some them but hit a small wall, It uses the Dbisam which id imangine was round 1998-2001

That is not that old - i have no doubt Elevatesoft still has copy of
those versions and as long as you own current you can get access
previous ones (just email support direct).

> procedure SetTableBlobSize(table:TDBISAMTable; blobSize:integer);
>     begin
>     with table do
>        begin
>        Active:=false;
>        RestructureFieldDefs.Update;
>        RestructureIndexDefs.Update;
>        RestructureTable(0,0,UserMajorVersion,UserMinorVersion,false,'','',blobSize,-1,true);
>        end;
>     end;
>

Looks OK


> I tried putting it tot he following
>
>   (99)     TDBISAMFieldDefs.Update;
>   (100)     TDBISAMIndexDefs.Update;
> (101)      AlterTable(0,0,UserMajorVersion,UserMinorVersion,false,'','',blobSize,-1,true);

You're re referring to the class itself instead of an instance of the
class so errors listed are correct.

dbisiam v4 version of this function would be this

procedure SetTableBlobSize(table:TDBISAMTable; blobSize:integer);
begin
  with table do
  begin
    Active:=false;
    FieldDefs.Update;
    IndexDefs.Update;

AlterTable(LocaleID,UserMajorVersion,UserMinorVersion,false,'',Description,IndexPageSize,blobsize);
  end;
end;

in this case it reuses the exsiting table values
(LocaleID,UserMajorVersion,UserMinorVersion and
Description,IndexPageSize). You can also reuse the encrypted password
properties but if no tables are encrypted then those are ok as defaults

Raul

Tue, Jan 13 2015 12:15 PMPermanent Link

Raul

Team Elevate Team Elevate

On 1/13/2015 12:12 PM, Raul wrote:
> On 1/13/2015 10:30 AM, Paul L wrote:
>> Ive remade some them but hit a small wall, It uses the Dbisam which id
>> imangine was round 1998-2001
>
> That is not that old - i have no doubt Elevatesoft still has copy of
> those versions and as long as you own current you can get access
> previous ones (just email support direct).

Also to add there is a good chapter in manual on moving from v3 to v4 :

http://www.elevatesoft.com/manual?action=viewtopic&id=dbisam4&product=delphi&version=6&topic=Changes

Even if your version is not v3 it should help

Raul
Tue, Jan 20 2015 11:12 AMPermanent Link

Paul L

Samu Games

Thanks for the replies, got it going and been reading the document, joys of bring archaic code up to standard, just fighitng against "Cannot perform this operation on an open database"  lol
Image