Corey
Corey

Reputation: 398

.DBF File Cannot Open in Shared Mode

I'm currently trying to debug an issue with a legacy system at my company. The original project was developed in the mid 90's, and everyone who knew the system has left the company. Currently we're seeing an error with one of the .DBF files, a simple table that holds no more than 4-5 columns, and barely any rows. The message the system is sending us is that we cannot open Message.dbf in Shared Mode.

Is there a way to open the database in an exclusive mode? We have a system with DBFManager and a Visual FoxPro 6.0 set up. Any hints, or links to information on these types of databases would be helpful. We have nobody with knowledge of these systems. I wish I could provide more detailed information, but I'm at a loss here.

So far we've tried replacing the file with several backups we had on the system, and restarting the server the .DBF file was located in (In case of a lock issue). So far nothing has solved the issue.

Upvotes: 0

Views: 3200

Answers (3)

Corey
Corey

Reputation: 398

We weren't able to debug exactly what the issue with opening the .dbf file was. In stead, we found a backup of the system that was several weeks old, and were able to restore the entire system to that state. The program is currently working fine, though we were unable to find the cause of the issue originally.

Upvotes: 0

Alan B
Alan B

Reputation: 4288

I haven't come across NetWare for many years, but back in the day I used to have continual fights with it because Client32 For Windows, when using default settings, did not play nicely with the FoxPro / Clipper DBF locking mechanism. This, for example.

Upvotes: 1

DRapp
DRapp

Reputation: 48139

You mention you have VFP 6... I would start with opening up VFP. In the command window, type

CD "C:\wherever Your Application Data is"    (enter)
use Message SHARED   (enter)
browse normal    (enter)

If you can see the content of the data, then there is no corruption going on with the file.

This obviously is a recent problem for such an old application. When you mention opening the file in "Shared" mode. Was there code added to open the file? If so, was the "Message" table already opened and in use by the same alias? If so, that would cause it to fail. You can't open the same table with the same "alias" name in two different work areas. If this is the case, you might be able to try and resolve by doing something like...

if used( "Message" )
   select Message
else
   select 0
   use Message
endif 

... continue with rest of code...

PER COMMENT / FEEDBACK

If it was from a server shut down, I HAVE seen that before where the file appears to be locked by a user from an invalid disconnect.  Sometimes, it just required all users to just logout / login again to force a release of all their resources to the server... but if the actual SERVER was shut down and restarted, then the users sessions would have been cleared anyhow.  I would check to see WHO the server still THINKS has the Message.dbf table still opened.  Additionally, if need be, kick all users out and manually use the table in VFP EXCLUSIVELY, and just for grins, PACK it

I would also do a backup via simple copy/paste of the entire folder where the data is located... THEN start VFP and do the following...

cd "whatever path"
use Message EXCLUSIVE
PACK
use

If it was part of a database, the database might be corrupted somehow / somewhere. To test that...

cd "whatever path"
close all
open database YourDatabase Exclusive
Validate Database

and see what it gives you

...

One more comment. I see you mention NetWare (Novell). Something I have seen in the past... Have there been any users recently deleted from the system (ie: from NetWare)? If so, and a file was originally created by "that user", then once that user is gone, so too are all permissions to do anything with that file. What you are best to do is login as administrator, select all the files and "Take Ownership" of them as administrator. The admin will never have restrictions to add/edit and can never be deleted as a user, thus never have this problem again. Again, just another option I remembered from history and MIGHT be part of the issue.

Upvotes: 2

Related Questions