Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Releasing object created with newobject
Message
De
12/05/2003 12:28:19
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00787386
Message ID:
00787389
Vues:
15
You can't release a property of the form this way. The RELEASE command is used to remove variables and arrays from memory. You cannot do this with properties. Setting the value to NULL should be enough.

>How do I release a an object that was created with newobject? I tried making the object null and I get a syntax error when releasing. Here is my code:
>
>
>
>WITH thisform
>	.oCon = NEWOBJECT('ConMgr','conmgr.prg')
>	.nCon = .oCon.OpenConn('itc_H_drive')
>	IF .nCon < 1
>		MESSAGEBOX('connection failed')
>		RETURN .f.
>	ENDIF
>	MESSAGEBOX('connection successful!!!')
>	SQLSETPROP(.nCon,"Asynchronous",.f.)
>	lnRes = SQLSETPROP( .nCon, "DispWarnings", .F. )
>	lcSql = "SELECT UD.SSNo, UD.firstname, UD.middle " ;
>	      + "  FROM UDFields UD " ;
>	      + " ORDER BY UD.SSNo "
>	lnRes = SQLEXEC( .nCon, lcSql, "lcresults" )
>	SELECT lcresults
>	*BROWSE
>	lnRes = .oCon.CloseConn(.nCon)
>	.oCon = null
>	RELEASE .oCon
>ENDWITH
>
>
>
>What am I doing wrong?
>
>Thanks
>Nick Patel
Thanks,
Dan Jurden
djurden@outlook.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform