Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Releasing object created with newobject
Message
From
12/05/2003 12:28:19
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00787386
Message ID:
00787389
Views:
18
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform