Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Releasing object created with newobject
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Releasing object created with newobject
Miscellaneous
Thread ID:
00787386
Message ID:
00787386
Views:
54
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
Next
Reply
Map
View

Click here to load this message in the networking platform