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

How do I know some one have FLOCK

Status
Not open for further replies.

Danwoo

Technical User
Oct 9, 2004
13
US
Hi again,

The following codes in my program keep adding a new blank record when someone in the network have FLOCK to the database,
----------------------------------

Use price shared new
dbappend()
if neterr()
@ say ... "soneone updating, try later..."
else
replace the fields...
endif

----------------------------------

How can I know some other application had FLOCK to the database so I can prevent to issue a DBAPPEND() command.

thanks in advance.

Larry
 
Sorry, the complete code should read like this:

Use price shared new
if neterr()
@ say ... "Cannot open file, try later..."
else
dbappend()
if neterr()
@ say ... "soneone updating, try later..."
else
replace the fields...
endif
endif

regards,

Larry
 
Look in your \Clipper5\source\sample directory for a file called LOCKS.PRG This contains AddRec, RecLock, NetUse and FileLock functions. They all return True of False if they succeed or fail. So you can then:

If NetUse(cFilename,lMode,nSeconds)
* Database used OK
* Set indexes
Else
Alert('Unable to open database')
* Break or return
EndIf

Ian Boys
DTE Systems Ltd
 
Hi Ians,
thanks for the instruction.

I forot about that, now I recall there is something in there.

regards,

Larry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top