Board index » delphi » Local_Share - Parameter changing by program?

Local_Share - Parameter changing by program?

Hallo,

how may I change the Local_Share-Parameter in the BDE by program? I write an
installation program for my customer which should better set it to "true".
Is it stored in the Registry? The normal installation changes this parameter
only if BDE is installed by it. An existing BDE is not altered.

Thanks,
Andreas

 

Re:Local_Share - Parameter changing by program?


See the example for DbiOpenCfgInfoList at
www.borland.com/devsupport/bde/bdeapiex .

--
Bill

Re:Local_Share - Parameter changing by program?


On Wed, 7 Feb 2001 21:03:20 +0100, "Andreas Vo?loh Software & Service"

Quote
<m...@vossloh-online.de> wrote:
>how may I change the Local_Share-Parameter in the BDE by program?

Try this:

  procedure SetLocalShare;
  const
     InitPath = '\System\Init';
     LocalShareDesc = 'LOCAL SHARE';
     LocalShareValue = 'TRUE';
  var
     Cursor: HDbiCur;
     ConfigDesc: CfgDesc;
  begin
     Check(DbiInit(nil));
     Check(DbiOpenCfgInfoList(nil, dbiReadWrite, cfgPersistent,
        InitPath, Cursor));
     try
        while DbiGetNextRecord(Cursor, dbiNoLock, @ConfigDesc, nil) =
                 0 do
        begin
           if StrIComp(ConfigDesc.szNodeName, LocalShareDesc) = 0 then
           begin
              if StrIComp(ConfigDesc.szValue, LocalShareValue) <>
                 0 then
              begin
                  Check(DbiGetRecord(Cursor, dbiWriteLock,
                    @ConfigDesc, nil));
                  StrPCopy(ConfigDesc.szValue, LocalShareValue);
                  Check(DbiModifyRecord(Cursor, @ConfigDesc, True));
              end;
           end;
        end;
     finally
        DbiCloseCursor(Cursor);
        DbiExit;
     end;
  end;

(put BDE in your uses clause)

You can put this code in the Initialization section of your main unit
to take immediate effect on the condition that all other BDE-using
applications are closed.

HTH,

Jan

Other Threads