Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Help for ReadAdminSettings...
Thu, May 17 2018 12:10 PMPermanent Link

Mesotech

Mesotech

Hello,

I'm migratting  a 4.26 delphi code to a 4.45 version…


I've got a problem with ReadAdminSettings…

For 4.26  I've this :
ReadAdminSettings(const CurPath: string;
                           const AppName: string;
                           var AdminSettings: TAdminSettings);

For 4.45 :
procedure ReadAdminSettings(const VersionInfo: TVersionInfo;
                           var AdminSettings: TAdminSettings);

So in my old code I've got :

PROCEDURE TDataModule1.Reconnect_OLD;
Var  DatabaseDescription, TempServerPath,FileNameRoot : string;
    AppAdminSettings: TAdminSettings;
Begin
 WAY_MAIN_APPLICATION:=extractfilepath(Application.exename);
      DBISAMSession1.Active:=false;

     with DBISAMSession3 do
     begin
       Active:=false;
       Remoteuser:='Admin';
       RemotePassword:='DBAdmin';
       Remoteencryption:=true;
       ReadAdminSettings(WAY_MAIN_APPLICATION,FileNameRoot,AppAdminSettings);
       SetAdminSettings(DBISAMSession3,True,AppAdminSettings);
       Active:=true;
      …..


So in the new code I will use a TversionInfo :


PROCEDURE TDataModule1.Reconnect_45;
Var  DatabaseDescription, TempServerPath,FileNameRoot : string;
    AppAdminSettings: TAdminSettings;
   vsf : Tversioninfo;
Begin
 WAY_MAIN_APPLICATION:=extractfilepath(Application.exename);
      DBISAMSession1.Active:=false;

     with DBISAMSession3 do
     begin
       Active:=false;
       Remoteuser:='Admin';
       RemotePassword:='DBAdmin';
       Remoteencryption:=true;
       vsf.FileNameRoot:=FileNameRoot;
       ReadAdminSettings( vsf,FileNameRoot,AppAdminSettings);
       SetAdminSettings(DBISAMSession3,True,AppAdminSettings);
       Active:=true;



what parameters of Tversioninfo I must fill ?
Do you have a sample code of uses of the ReadAdminSettings procedure please ?

With best regards,
Mesotech
Thu, May 17 2018 2:13 PMPermanent Link

Mesotech

Mesotech

Hello,

May be Just using tversioninfo without parameters is enough?


With best regards,
Mesotech
Thu, May 17 2018 2:41 PMPermanent Link

Raul

Team Elevate Team Elevate

On 5/17/2018 12:10 PM, Mesotech wrote:
> I've got a problem with ReadAdminSettings…

I'm not really sure why you're using it at all but ok.

> what parameters of Tversioninfo I must fill ?
> Do you have a sample code of uses of the ReadAdminSettings procedure please ?

ReadAdminSettings is in dbisamut.pas (utilcomps folder) and versioninfo
is simply used to build the path to the ini file (GetIniFileName call)


Raul
Thu, May 17 2018 2:44 PMPermanent Link

Raul

Team Elevate Team Elevate

On 5/17/2018 2:41 PM, Raul wrote:
> On 5/17/2018 12:10 PM, Mesotech wrote:
>> I've got a problem with ReadAdminSettings…
>
> I'm not really sure why you're using it at all but ok.
>
>> what parameters of Tversioninfo I must fill ?
>> Do you have a sample code of uses of the ReadAdminSettings procedure
>> please ?
>
> ReadAdminSettings is in dbisamut.pas (utilcomps folder) and versioninfo
> is simply used to build the path to the ini file (GetIniFileName call)

Look at srvadmin source - it uses this

Raul
Thu, May 17 2018 3:14 PMPermanent Link

Mesotech

Mesotech

Hello Raul,

Big thank you for your help.

With best regards,
Mesotech
Image