Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Releasing object created with newobject
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
Releasing object created with newobject
Divers
Thread ID:
00787386
Message ID:
00787386
Vues:
51
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform