Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
When Close Tables Doesn't
Message
De
13/07/2005 11:28:10
 
 
À
13/07/2005 09:05:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01031910
Message ID:
01032252
Vues:
16
I dunno. To me it's just another reason to avoid filtered result sets. There are simply strange things involved with those abominable creations!

You should solve the problem by adding NOFILTER to the Select-SQL statement in question and these types of problems disappear.

cheers


>Yes, but why is that? I had to manually force the table to close specifying it explicitly.
>
>>Could the other process be creating a "filtered result set" in a Select-SQL statement?
>>
>>I've found that a table in such a state (acting as a cursor but really a filtered result set) cannot be closed.
>>
>>good luck
>>
>>
>>>I have a small executable that is a conversion utility. It calls two other apps. In most cases tables are opened, a process is run, and then tables are closed using CLOSE TABLES in VFP9. For some reason, I have stepped through this and closing tables doesn't. The below code is in the same prg except that openfiles function is in the main calling program of the primary app. Code:
>>>
>>>
>>>=OpenFile(ddir,'POLICY_D','MASTER',.T.,'SYSNUM')
>>>=OpenFile(scdir,'POLICY_D','SCMAST',.F.,'SYSNUM')
>>>=OpenFile(ddir,'POLICY_H')
>>>
>>>*--Process runs here
>>>
>>>CLOSE TABLES && appears to close all tables in the default data session but not alias 'MASTER'
>>>
>>>*--the first openfile line below fails because master is still open from above - close tables
>>>*--did not close it for some reason?  I have stepped through this and each line is processed
>>>*--but master remains open and the data session is still the default data session
>>>*--_vfp.autoyield should have any effect here
>>>
>>>=OpenFile(ddir,'POLICY_D','MASTER',.F.,'SYSNUM') && master is in still use for some reason?
>>>=OpenFile(scdir,'POLICY_D','SCMAST',.F.,'SYSNUM')
>>>
>>>*--Another process runs here
>>>
>>>CLOSE TABLES
>>>RETURN
>>>
>>>*--------------------------------------------------
>>>FUNCTION OpenFile
>>>PARAMETERS sDir, sFile, sAlias, bZap, sOrder
>>>
>>>IF EMPTY(sAlias)
>>>   sAlias = sFile
>>>ENDIF
>>>
>>>llFailed = .F.
>>>
>>>TRY
>>>
>>>   SELECT 0
>>>   USE (sDir+sFile) EXCLU ALIAS (sAlias)
>>>
>>>CATCH TO ErrObj
>>>
>>>   MsgText = "Error "+TRANSFORM(ErrObj.ERRORNO)+": "+;
>>>      ErrObj.MESSAGE +;
>>>      CHR(13)+CHR(13)+;
>>>      IIF(ErrObj.ERRORNO = 1705,'Could not open the file:'+CHR(13)+;
>>>      sDir+sFile+CHR(13)+'excusively.'+CHR(13)+CHR(13),;
>>>      'Could not open the file:'+CHR(13)+;
>>>      sDir+sFile+CHR(13)+CHR(13))
>>>   MESSAGEBOX(MsgText, 0+16+4096,'Error')
>>>   llFailed = .T.
>>>
>>>ENDTRY
>>>
>>>IF !llFailed
>>>   IF !EMPTY(sOrder)
>>>      SET ORDER TO TAG (sOrder)
>>>   ENDIF
>>>
>>>   ON ERROR DO sysErrMess IN MAIN WITH ;
>>>      ERROR(), MESSAGE(), MESSAGE( 1), PROGRAM(), LINENO()
>>>
>>>   IF bZap
>>>      ZAP
>>>   ENDIF
>>>
>>>   RETURN
>>>ELSE
>>>
>>>   ON ERROR DO sysErrMess IN MAIN WITH ;
>>>      ERROR(), MESSAGE(), MESSAGE( 1), PROGRAM(), LINENO()
>>>
>>>   StopLoop = .T.
>>>
>>>ENDIF
>>>
>>>RETURN
>>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform