Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error Message - Cannot Access Table
Message
 
 
À
11/08/2003 22:25:01
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00819030
Message ID:
00819234
Vues:
13
>Hello Nadya:
>
>>Can you check, if PatientDemo is used?
>>
>Yes it is being used.
>
>>>>Also, may be the problem is that these cursors are somehow closed. Do you know, where do you close these cursors?
>
>This is where the problem appears to be.
>
>
	* Select and display Long-Term Regimen
>	SELECT Regimen, StartDate, EndDate, TReference, DocName, ;
>		DocNum FROM Treatment INTO CURSOR CurTreatment NOFILTER ;
>	WHERE Treatment.HealthNum = mHealthNum and;
>		NOT empty(Treatment.Regimen)
>	
>	*thisform.pageframe1.page5.ravibasegrid1.RecordSource = ""
>	thisform.pageframe1.page5.ravibasegrid1.RecordSource = "CurTreatment"
>
>	thisform.pageframe1.page5.ravibasegrid1.column1.header1.Caption = "Regimen"
>	thisform.pageframe1.page5.ravibasegrid1.column1.header1.FontName = "Tahoma"
>	thisform.pageframe1.page5.ravibasegrid1.column1.header1.FontSize = 8
>	thisform.pageframe1.page5.ravibasegrid1.column1.Width = 250
>
>	thisform.pageframe1.page5.ravibasegrid1.column2.header1.Caption = "Start Date"
>	thisform.pageframe1.page5.ravibasegrid1.column2.header1.FontName = "Tahoma"
>	thisform.pageframe1.page5.ravibasegrid1.column2.header1.FontSize = 8
>	thisform.pageframe1.page5.ravibasegrid1.column2.Width = 110
>	
>	thisform.pageframe1.page5.ravibasegrid1.column3.header1.Caption = "End Date"
>	thisform.pageframe1.page5.ravibasegrid1.column3.header1.FontName = "Tahoma"
>	thisform.pageframe1.page5.ravibasegrid1.column3.header1.FontSize = 8
>	thisform.pageframe1.page5.ravibasegrid1.column3.Width = 110
>
>	mRegimen = CurTreatment.Regimen
>	mStartDate = CurTreatment.StartDate
>	mEndDate = CurTreatment.EndDate
>	mUpdateTreatmentNumber = CurTreatment.TReference
>	mDisplayDocName = CurTreatment.DocName
>	mDocNum = CurTreatment.DocNum
>	
>	* This is to ensure that Enter Data is clicked if Treatment is blank
>	IF EMPTY(mRegimen)
>		thisform.pageframe1.page5.ravieditbox1.Enabled = .f.
>	ELSE
>		thisform.pageframe1.page5.ravieditbox1.Enabled = .t.
>	ENDIF
>
>The "Cannot access selecetd table" messge only comes after I access page4 of pageframe1. If i don;t access that page, I do not get the error message.
>
>>I would comment out CLOSE TABLES in Destroy (you don't need it if you have AutoClose set to .t.) and see, if it makes the difference. In any case, it sounds like these cursors are already somehow closed, which should not be. Can you find out, what method closes them?
>
>Where should I set the AutoClose Property?
>
>Thank you Nadya for your time.

Hi Henry,

Sorry for the delay with the response, I didn't notice that you replied before. AutoClose is the property of DataEnvironment and it is .t. by default.

In the above code I don't see any reference to page4, only page5.

Also is there a typo in this fragment:

SELECT Regimen, StartDate, EndDate, TReference, DocName, ;
DocNum FROM Treatment INTO CURSOR CurTreatment NOFILTER ;
WHERE Treatment.HealthNum = mHealthNum and;
NOT empty(Treatment.Regimen)

For strange reason the last line is shown in green here in UT, could be a problem with the parser... I usually put a space between semicolon and put INTO clause into the end of the statement. Of course, that's just a personal preference...


This piece of code could be simplified:
>	IF EMPTY(mRegimen)
>		thisform.pageframe1.page5.ravieditbox1.Enabled = .f.
>	ELSE
>		thisform.pageframe1.page5.ravieditbox1.Enabled = .t.
>	ENDIF
to

thisform.pageframe1.page5.ravieditbox1.Enabled = not empty(m.mRegimen)

but this is unrelevant too. I will try to look closely, but for now try to comment out this whole block of code and see, if the error still appears...
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform