Board index » delphi » Settting Local Share To True at Run TIme

Settting Local Share To True at Run TIme

Is it possible to set local share to true at run time?  The BDE Help file on
line reference doesn't seem to provide a procedure or function to do so.
Any code samples available?

Thanks

Charles Wood

 

Re:Settting Local Share To True at Run TIme


Take a look at
http://www.borland.com/devsupport/bde/bdeapiex/dbiopencfginfolist.html

Gert

Quote
> Is it possible to set local share to true at run time?  The BDE Help file on
> line reference doesn't seem to provide a procedure or function to do so.
> Any code samples available?

Re:Settting Local Share To True at Run TIme


You cannot set Local Share to true at runtime. The best you can do is to
change the Local Share setting in the BDE config file from your application
before the default BDE session starts. To see how to do this see the
examples for DbiOpenCfgInfoList at www.borland.com/devsupport/bde/bdeapiex .

Bill
(TeamB cannot answer questions received via email.)

Re:Settting Local Share To True at Run TIme


Yes, you can do it.

On the INITIALIZATION Section of your main form

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;

"Charles Wood" <cfw...@thegrid.net> escribi en el mensaje
news:3b6177e8$1_1@dnews...

Quote
> Is it possible to set local share to true at run time?  The BDE Help file
on
> line reference doesn't seem to provide a procedure or function to do so.
> Any code samples available?

> Thanks

> Charles Wood

Re:Settting Local Share To True at Run TIme


Thanks for all the help.

Other Threads