Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > How can i access dbf non exclusive?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-18-08, 10:00
thparian thparian is offline
Registered User
 
Join Date: Jun 2008
Posts: 1
Question 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
Reply With Quote
  #2 (permalink)  
Old 01-02-09, 15:13
jkuiper jkuiper is offline
Registered User
 
Join Date: Dec 2008
Posts: 9
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.
Reply With Quote
  #3 (permalink)  
Old 01-02-09, 16:16
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 9,570
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
Reply With Quote
  #4 (permalink)  
Old 01-02-09, 16:40
jkuiper jkuiper is offline
Registered User
 
Join Date: Dec 2008
Posts: 9
As far as I know (I'm using Delphi) there is as property called share mode. This wil regulate the rlocks in dbase.
Reply With Quote
  #5 (permalink)  
Old 01-05-09, 08:10
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 9,570
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On