Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2008
    Posts
    1

    Question Unanswered: How can i access dbf non exclusive?

    Hello all,

    I have an application that i want to open 2 times simultaneous and access the same dbf file.The application is written in c++ and as it works now when it opens the dbf file i can't open the same file with dbu.exe for example.

    Have you any idea how can i modify my code so it doesn't open the dbf file exclusively?

    Thanks

  2. #2
    Join Date
    Dec 2008
    Posts
    8
    You can't. dcu.exe needs exclusive rights, because the have to write the structure to the table itself. But it is possible to use the table in shared mode for access the table on different pc's.
    It is better to use a database server.

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Just open the DBF file in shared mode from your C++ program. The trick is getting C++ functions that integrate with Clipper's FLock() and RLock() functions. FLock() is easy, since that only requires setting an intent on the whole file. RLock is more challenging, but I'm pretty sure that I've got the code I wrote about ten years ago that implements RLock() up through Clipper 5.0.

    -PatP

  4. #4
    Join Date
    Dec 2008
    Posts
    8
    As far as I know (I'm using Delphi) there is as property called share mode. This wil regulate the rlocks in dbase.

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Delphi uses BDE, which supports the dBase locking model for RLock(). The locking model for FLock() is common across all of the *.DBF engines that I know, but the RLock() model varies considerably.

    DBU.EXE is a Clipper program, so to peacefully work with it your C++ program will need to use the Clipper record locking model.

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •