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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Sample Code dBASE 5.0 for DOS

Status
Not open for further replies.

singlenerd

Technical User
Sep 26, 2007
25
US
Hello,

Another approach to my error issue might be to see some sample error trapping code. If anybody is willing to post some sample code that might be able to help me figure out what I need to do. Though, the could would need to be in dBASE 5.0 for DOS.

Thanks

---
"One source to query, one source to answer and one source to bind them." Aaron Sharp
 
Fist we would need to know Exactly why you need to access a table that is locked and why the code has the table locked.

if you want to just simple yait for the table to be unlocked then go into a loop until you can get the file exclusive.

do while lock() = .F.
.... Screen eror message .......
enddo
use Table Exclusive.



David W. Grewe Dave
 
David,

The larger idea that spawned this post was that we need to know who has the file.

We've tried lksys(), but in the case of exclusive the information contained can only be accessed by the user of the file.

We are currently thinking of a semaphore like system where when a person locks or uses a file exclusive it gets reported to a table. That table would then be referenced before a file is to be used. The entry would also need to be cleared when the file is no longer in use.

We were hoping for an easier way to get the information, but it seems like dBASE 5.0 for DOS doesn't have it or we can't see it.

---
"One source to query, one source to answer and one source to bind them." Aaron Sharp
 
Been that route before. I have a Data Dictonary table in all my applications and I used to do something like you want to do.

The Sys_Dict.dbf had a field named Locked, L.
The program with make the field .t. when a person needed the dbf Exclusive. The system would then change the field back to .F. when is no longer needed the table exclu.

The problem was the users. Normally they would walk away from the computer when the table was locked and/or go home with the application running. About 2-3 times a week some one would Ctrl-Alt-Del and exit the Application and the Sys_Dict sitll reported the table locked and noone could get to the table untill a maintennace program was run to change the Sys_Dict.Locked field back to .F.

I gave up on the process after runniung the maintenace routine after binmg called in from home in the middle of the night to fix a night routnue that did not run right.

In Short I have no Solution for you. I just looked in the Server Operating system to see who had a file open when I needed it. The night access proble was solved by placing users in groups, only allow access to files by groups. The groups were limited access to the network by time. This way after 5pm all users of a group were disconnected from the network and the files were freed up within minutes.


David W. Grewe Dave
 
If you are running from a file server, you should be able to see at the sewrver who is locking the file.

You can then establish what program module is being run by that person which locks the table.

Your programs may be badly written in the sense that a person can go for lunch leaving a table locked indefinitely.
 
Cricket,
Yea I agree, My programming back in the days of DOS needed some help, I grew up and learned more since then.

Quick, Hire all the teenagers you can get your hands on while they know everything.


David W. Grewe Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top