Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP6 How to detect a table in use by views
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
VFP6 How to detect a table in use by views
Divers
Thread ID:
00948339
Message ID:
00948339
Vues:
54
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
___________________________________________
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform