Link to home
Start Free TrialLog in
Avatar of chechomoon
chechomoon

asked on

Terminal Services and Paradox DB

Hi! I have an app developed in Delphi 6 with Paradox DB, I want to run my app in my server with Win2003 Sever operating system accessing by terminal server, but I have a problem when more than one user access the same application's option , if one of them change and save data and the second user do the same, the first user's changes lost, just change maked by the second user persist.

   I think TS make a virtual sesion with a database copy, when user save his/her changes TS replace all database file not just the records affected.

     Tnksfor your help.

    I'm sorry my English.
Avatar of vadim_ti
vadim_ti

Check BDE settings

must be
LOCALSHARE=TRUE

but default is
LOCALSHARE=FALSE
Avatar of chechomoon

ASKER


 Thanks vadim_ti, i set LOCALSHARE =TRUE, and it solved the problem with two user over the same app's option, but it generate another error message when I try to access other app

      Directory is controlled by other .NET file
      Directory: C:\x\y\z
      File: C:\x\y\PDOXUSRS.LCK

   and don't let me execute the app2... app1 and app2 are in the same directory, and the BDE Setting NET Dir = C:\x\y\netdir, this dir contained the file PDOXUSRS.LCK ,

   I access the app1 correctly, but when a try to run app2 over the same Terminal service Sesion , it show me that msg,

      Thnks for your help

Thanks vadim_ti, i set LOCALSHARE =TRUE, and it solved the problem with two user over the same app's option, but it generate another error message when I try to access other app

      Directory is controlled by other .NET file
      Directory: C:\x\y\z
      File: C:\x\y\PDOXUSRS.LCK

   and don't let me execute the app2... app1 and app2 are in the same directory, and the BDE Setting NET Dir = C:\x\y\netdir, this dir contained the file PDOXUSRS.LCK ,

   I access the app1 correctly, but when a try to run app2 over the same Terminal service Sesion , it show me that msg,

      Thnks for your help
Avatar of kretzschmar
usual the netdir should be pointed to a directory,
which is shared with full access rights to all clients

also the pathname should be for all clients exactly the same entry

-> you cannot have this netdir local for each client

meikl  ;-)
i think you can try next
1) delete all PDOX*.LCK files and PDOX*.NET files
2) if you have Data Module and TDataBase component, assign NetDir and PrivateDir of TDatabase in OnCreate Datamodule event



    PrivDir := 'C:\x\y\'+IntToHex(GetCurrentThreadId, 8);
    if not DirectoryExists(PrivDir) then
      ForceDirectories(PrivDir);
    DB.Params.Clear;
    DB.Params.Add('PATH=' + pathToDB);
    DB.Session.NetFileDir := GetCurrentDir;
    DB.Session.PrivateDir := PrivDir;
    DB.Connected := TRUE;

PrivDir must be unique for every session, you can use GUID or something else, in example i used GetCurrentThreadId
NetFileDir must be common for all sessions working with the same database

  Ok guys Thanks so mouch for your help,

  but  I still have the problem, I have two delphi app's (app1, app2) that use Paradox DB. I want to run my app's in my Server Win2003 via Terminal Services, my two app's use the same DB.

   My first problem was... when more than one user access the same application's option (app1) , if one of them change and save data and the second user do the same, the first user's changes lost, just change maked by the second user persist'

   I set DBE Settings   'LOCALSHARE=True' and set 'NetDir' to shared dir with full access, and it works... but it generated other problem, when I try to run app2 I get an error msg

      Directory is controlled by other .NET file
      Directory: C:\x\y\z
      File: C:\x\y\PDOXUSRS.LCK

   (I coneccted to my server such as administratror)

   then I set back LOCALSHARE=False, and it fix the problem, but I get back to original problem

   Please Help me!!

   chechomoon
ASKER CERTIFIED SOLUTION
Avatar of vadim_ti
vadim_ti

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

 Ok, I created direcotries

      C:\NET \
      C:\ dir_X \ app1 \
      C:\ dir_X \ app2 \

   and I did what you suggest

in first application

TDatabase1.Connected := false;
TDatabase1.Session.Netdir := 'C:\dir_x\ NET';
TDatabase1.Session.Privatedir := 'C:\dir_x\APP1';

in second application

TDatabase1.Connected := false;
TDatabase1.Session.Netdir := 'C:\dir_x\NET';
TDatabase1.Session.Privatedir := 'C:\dir_x\APP2';

   I run my app1 and it run correctly, but when I try to run app2 I get the same message

 Directory is controlled by other .NET file
 Directory: C:\ dir_x \ app2 \
 File: C:\ dir_x \ app2 \ PDOXUSRS.LCK

 Thanks for your help
 

   Ok, I got it, I set NetDir to the application default dir, it fix the problem and let me run my two app's,

    Thanks for your help.

   chechomoon

it is like a problem was with spaces in directory name
i replaced spaces with stars
paradox compare net directory name literally

 Directory is controlled by other .NET file
 Directory: C:\*dir_x*\*app2*\
 File: C:\*dir_x*\*app2*\*PDOXUSRS.LCK