#1
  1. Senior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    421
    Rep Power
    11

    Question Updating NET DIR property of paradox table?


    Hi guys.

    I have a feeling nobody will know what I'm on about but who cares, here goes;

    I've installed an application called Tranman which is Borland based and uses something in the control panel called BDE administrator to set up databases.
    I'm trying to change the NET DIR property of the PARADOX table, and NEED TO DO IT VIA A VB APP. When I surf Google, I get a lot of Delphi examples but no VB examples.

    Can anyone help me with this??
    Captain Planet.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2002
    Posts
    693
    Rep Power
    26
    Converting the code from delphi shouldn't be that hard. Post the delphi code and someone will help you convert it.
  4. #3
  5. Senior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    421
    Rep Power
    11
    Here's a link I stumbled across:

    http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_10076629.html
    Captain Planet.
  6. #4
  7. Senior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    421
    Rep Power
    11
    Or if you can't get to that link:
    Code:
    // ChangeNetDir
    procedure ChangeNetDir(Drive: Char);
    var
      hCur: hDBICur;
      Config: CFGDesc;
      Cont: Boolean;
    begin
      if DbiInit(nil) = DBIERR_NONE then
        begin
          hCur := nil;
          if DbiOpenCfgInfoList(nil, dbiREADWRITE, cfgPersistent,
            '\DRIVERS\PARADOX\INIT', hCur) = DBIERR_NONE then
            begin
              if DbiSetToBegin(hCur) = DBIERR_NONE then
                begin
                  Cont := True;
                  while Cont do
                    begin
                      if (DbiGetNextRecord(hCur, dbiWRITELOCK, @Config, nil)
                        <> DBIERR_NONE) then
                        Cont := False
                      else if StrIComp(Config.szNodeName, 'NET DIR') = 0 then
                        begin
                          StrPCopy(Config.szValue, Drive + ':\');
                          DbiModifyRecord(hCur, @Config, True);
                          Cont := False
                        end;
                    end;
                end;
            end;
          DbiExit();
        end;
    end;
    
    
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      ChangeNetDir('H');
    end;
    Captain Planet.

IMN logo majestic logo threadwatch logo seochat tools logo