Board index » delphi » "Network initialization failed" and "wrong .NET file"

"Network initialization failed" and "wrong .NET file"

Hi!

One of our client wrote a Delphi application, using BDE (Paradox).
The database is on a network share mapped as local drives on the
client machines. When she run her program, she get
"Network initialization failed" and "Wrong .NET file version" error
messages. When the database is on the local machine, everything
is OK.
We are absolutely unfamiliar with Delphi and BDE, but we would
like to help her. The network is functioning properly, so we think
that some BDE or paradox configuration setting could cause the
problem.
Can somebody tell me a possible solution?
THX

?rd?gh Lszl
Digital Ltd., Hungary
ordo...@digital.co.hu

 

Re:"Network initialization failed" and "wrong .NET file"


Hi ?rd?gh,

You could try this code:

ForceDirectories('c:\netdir');
Session.NetFileDir := 'c:\netdir';

If this doesn't solve it, then maybe this helps (copied from the company
where I sometimes work, sshht :)

  procedure SetPrivateDir;
  var
    len, ti : integer;
    Buffer : PChar;
    basePad, fullPad : string;
    sr : TSearchRec;
  begin
// skip this    basePad := GtCfgStr('BDE', 'PrivateDir');
    if basePad = '' then
    begin
      // Instellen PrivateDir aan de hand van GetTempPath:
      // 1. The path specified by the TMP environment variable.
      // 2. The path specified by the TEMP environment variable, if TMP is
not defined.
      // 3. The current directory, if both TMP and TEMP are not defined.
      len := 512;
      Buffer := AllocMem(len);
      try
        GetTempPath(len, Buffer);
        basePad := Buffer + 'kraan\' + KrnApplic.Sysletters + '\privat';
      finally
        FreeMem(Buffer, len);
      end;
    end;

    // Door de current directory in te stellen op de gewenste privatedir
wordt de
    // default privatedir hierop ingesteld. Wordt direct de privatedir
ingesteld
    // via Session.PrivateDir dan wordt maar n gebruiker toegestaan.

    // Commentaar op voorgaande:
    // Current directory werkt bij initialisatie van de BDE. Dat is al
eerder gebeurt, dus werkt dit
    // niet. Daarnaast wordt bij opstarten van een 2e BDE applicatie de BDE
niet opnieuw geinitialiseerd.

    // Commentaar op voorgaande:
    // Weer wat nieuws verzonnen. Het blijkt dat bij instellen van de
session.privatedir deze door de BDE
    // wordt gelocked mbv een paradox.lck file. Indien dit het geval is een
nieuwe dir creeeren.

    ti := 1;
    fullPad := basePad + IntToStr(ti);
    while (SysUtils.FindFirst( fullPad + '\Pdoxusrs.lck', faAnyFile, sr ) =
0) do
    begin
      SysUtils.FindClose( sr );

      // Eventueel niet meer in gebruik zijnde files weggooien.
      if SysUtils.DeleteFile( PChar( fullPad + '\Pdoxusrs.lck' ) ) then
      begin
        if SysUtils.DeleteFile( PChar( fullPad + '\Paradox.lck' ) ) then
          Break;
      end;

      Inc(ti);
      fullPad := basePad + IntToStr(ti);
    end;
    ForceDirectories( fullPad );
    Session.PrivateDir := fullPad;
  end;

I'm not 100% sure if these 2 solutions work for you, but it's worth trying
out.

Regards,
- Robert

?rd?gh Lszl heeft geschreven in bericht <3997a424_2@dnews>...

Quote
>Hi!

>One of our client wrote a Delphi application, using BDE (Paradox).
>The database is on a network share mapped as local drives on the
>client machines. When she run her program, she get
>"Network initialization failed" and "Wrong .NET file version" error
>messages. When the database is on the local machine, everything
>is OK.
>We are absolutely unfamiliar with Delphi and BDE, but we would
>like to help her. The network is functioning properly, so we think
>that some BDE or paradox configuration setting could cause the
>problem.
>Can somebody tell me a possible solution?
>THX

>?rd?gh Lszl
>Digital Ltd., Hungary
>ordo...@digital.co.hu

Re:"Network initialization failed" and "wrong .NET file"


The BDE is not configured correctly. See
http://community.borland.com/article/0,1410,15247,00.html .

--
Bill Todd (TeamB)
(Questions received via email cannot be answered.)

Re:"Network initialization failed" and "wrong .NET file"


Quote
>"Network initialization failed" and "Wrong .NET file version" error
>messages. When the database is on the local machine, everything
>is OK.

Sounds like there is a Paradox Dos program using the same tables or some other
program that uses Paradox tables and the old DOS stile net file.
You can try deleting all the .lck files in directories the application uses but
if there is another program using the tables that uses the old style locking the
problem will return.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads