Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP program in terminal environment
Message
De
18/09/2007 10:35:39
 
 
À
18/09/2007 10:34:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01252991
Message ID:
01255128
Vues:
30
>>>>But the problem is that there is running MS Access program, which requires a lot of memory on the same server, but it runs fast, while VFP programs running slower and slower until server restarts...
>>>
>>>The scenario you describe, clearly indicates that you have some dangling references in your VFP program. See http://fox.wikis.com/wc.dll?Wiki~OOP,GarbagecollectionAndDanglingObjectReferences...~VFP
>>
>>Thanks for good link...
>>I think I know where is the problem:
>>My VFP program uses MS Excel to produce reports:
>>
>>LOCAL objXlsApp, objXlsSheet
>>
>>objXlsApp = CreateObject("Excel.Application")
>>objXlsApp.Workbooks.Open("C:\Template.xls", .T., .T.)
>>objXlsSheet = objXlsApp.Workbooks("Template.xls").WorkSheets("Sheet1")
>>objXlsSheet.Range("A1").Value = "Test"
>>objXlsApp.Workbooks("Template.xls").SaveAs("C:\Report.xls")
>>objXlsApp.Application.Visible = .T.
>>

>>
>>Can it cause the problem?
>>Will it help if I includes this code in the end?:
>>
>>RELEASE objXlsApp, objXlsSheet
>>

>Yes, it will help! To be 100% safe, you should assign .null. to the variables before releasing them
>objXlsSheet=.null.
>objXlsApp=.null.
>Release objXlsApp
>Release objXlsSheet
NB! UT does not support < code >, you must use < pre >
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform