Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP seems to get data from a table without opening it!
Message
From
05/05/2008 16:14:35
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01315181
Message ID:
01315190
Views:
21
That is what I have always thought, Sergey, but in this case the table definitely was not open (alias was not used and table does not show in the data session window) before the second time select was issued, the array was filled correctly by the select, and the table was not opened by the select. Very weird. Based on your comment I checked SET('SQLBUFFERING') and it was 'OFF'.

tcDataDict = 'DD_Fac_Int' which is the stem of the DBF and also the Alias.

What can be happening? Thanks for the help.

Alex


>No, FoxPro will always read from a table/cursor unless WITH clause is used. What is the value of tcDataDict? The USED() function expects an alias and will return .F. if you give it full table name. The SELECT-SQL can work with both.
>
>>I found an unexpected situation:
>>
>>A method has the following code:
>
>>LPARAMETERS tcDataDict   && Has value of 'DD_Fac_Int'
>>LOCAL llCloseDBF,laFields[1,4]
>>llCloseDBF = !USED(tcDataDict)
>>SELECT _fieldname,_fieldtype,_fieldlen,_field_dec FROM (tcDataDict) INTO ARRAY laFields
>>IF llCloseDBF
>>   USE IN (tcDataDict)
>>ENDIF
>>...
>>RETURN
>
>>The method is called twice. The first time it works as I expected, namely the (tcDataDict) table is closed after the SELECT.
>>
>>During the second call llCloseDBF takes on .F. before running the SELECT, and the laFields array is filled as expected, but the (tcDataDict) table is NOT opened, so USE IN (tcDataDict) gives error. Apparently VFP finds the data (perhaps from cache) without opening the (tcTableDict) table. I did not expect this behavior. Should I have expected it?
>>
>>TIA,
>>
>>Alex
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform