Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BDE/Paradox: Multiuserdatabase access on Vista => application hangs

Status
Not open for further replies.

Mxone424

Technical User
Sep 28, 2009
4
US
Summary:
A BDE-App (written in D7) is used on several client computers, all clients access the same database. The database files are on a VISTA-machine, clients are also VISTA
Problem: On first Client, the app starts normal, on the second it hangs on this line of code, where for the first time, a table is opened.

Anyone seen something like this, or any ideas? For hints, I would be very thankful.
Who knows, what exactly the bde doies on the PDOXUSRS.NET file?
I have made a demonstration app. ( BDE must be installed separately) that I can send you

*******************************************************************
I know that I should get rid of the BDE, already working on it, but I need to bridge the time until this is done with a workaround.
The app must run on customer systems (XP, VISTA). I'm NOT interested in suggestions like:
Get rid of BDE, Run your app in a virtual machine, use Novell or windows 2003 as file server.....
*******************************************************************

Details:
* The problem occured, when the database files were located on a VISTA Computer. I tested Ultimate, business and 2008 Server. Access to files via explorer (New file, edit file...) works without problems,
* everythin works fine with data files on X or 2003 Server, or Novell
* PDOXUSRS.NET is located in a central folder on the Vista computer, path is given via UNC and is the same for all clients
* the well known oplocks-disable settings have been carried out on all computers, and checked via bdechecker
* on first client, app starts normal, on second one it hangs on that lines that tries to open a table (exclusive=False) for the first time. I've made a test app to show the problem
* on a XP Client I saw the error message: „Exception. Network initialization failed. Lock Time out. File: PDOXUSRS.NET. Directory: < path of PDOXUSRS.NET File >"
* randomly, on Vista Clients I saw the error message: „Cannot lock network file. Operating system network error. File: PDOXUSRS.NET. File"
* I tried with and without UAC, no difference

I suppose: If BDE tries to get a special share access to the pdxousrs.net file, it fails if the file is on a Vista Computer

I saw someone had this exact same problem on here. When i clicked on the link to see the solution the link was dead. Can anyone please help.

Thanks
 
One thing Vista does is lock down certain folders from being changed. Make sure your application is not installed in c:\program files (x86) or c:\program files.

Look around for disabling OpLocks or opportunistic locking so that your network files are being updated right away and that the workstation isn't holding on to it's own copy of the file. (Ah - I see you've done this already.)

Give "Everyone" full rights to the containing folder.

 
Using D7, I am midway thru an interim db transition from Paradox to MySQL. The database is in a shared folder on Server 2003. All XP clients have the parent folder mapped as drive "F:". We have [red]NO Vista[/red] clients or experience. Paradox locking used to give me fits until I added the following code to my apps. Understanding all of the code is difficult without possession of BDE.pas source code. I don't. I also don't remember where I got this code. It may or may not help you but it saved my life.

The code is at the tail end of my INI unit with all my globals and gets called before anything opens, as you can see:

Code:
procedure SetBdeDir;
var
  hCur : hDBICur;
  Config : CFGDesc;
  ContinueIt: 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
        ContinueIt := true;
        while ContinueIt do begin
          if(DbiGetNextRecord(hCur, dbiWRITELOCK, @Config, nil) <> DBIERR_NONE) then
            ContinueIt := false
          else if StrIComp(Config.szNodeName, 'NET DIR') = 0 then begin

            StrCopy(Config.szValue, 'F:\QcMenu');
            (* NOTE: THIS IS OUR LOCATION OF PDOXUSRS.NET *)

            DbiModifyRecord(hCur, @Config, true);
            ContinueIt := false
          end;
        end;
      end;
    end;
    DbiExit();
  end;
end; //SetBdeDir

initialization
begin
  if DirectoryExists('F:\QCMenu') then begin
    DefaultDb:= 'F:\QCMenu\@Data'; //location of pdox tables
    SetBdeDir;
  end else
    //drive is not mapped
end;

finalization
begin
end;

end.
It may also be worth noting that the EXE is located locally for each client PC. (C:\Program files\here\)

Good luck!

Roo
Delphi Rules!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top