Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 How to detect a table in use by views
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
VFP6 How to detect a table in use by views
Miscellaneous
Thread ID:
00948339
Message ID:
00948339
Views:
53
Hi all

I want to delete and pack old records. So in the utility I get the date for deletion of data but the following code fails when there is a view is opened with the tables in question. I used buffered views for the forms.
WAIT WINDOW "Deleting Requisition Slips  ..." NOWAIT

wait window "tpatients " + iif(USED("tPatients"), "true", "false")  && returns false
wait window "spatients " + iif(USED("sPatients"), "true", "false")  && returns false

IF (NOT USED("tPatients")) AND (NOT USED("sPatients"))
	USE sPatients IN 0 EXCLUSIVE AGAIN
	USE tPatients IN 0 EXCLUSIVE AGAIN

	*!*		DELETE FROM tPatients ;
	*!*			WHERE dDt <= THISFORM.dAsOfDt ;
	*!*				OR EMPTY(dDt)
	*!*
	*!*		PACK

	USE IN tPatients
	USE IN sPatients
ELSE
	lcMsg = lcMsg + "Cannot Open Requisition Slip for Deletion" + CHR(13)
ENDIF
Please advise for a way to safely delete and pack records. We are assuming the user is not aware that forms have to be closed before executing such utilities.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Next
Reply
Map
View

Click here to load this message in the networking platform