Date:  06/27/2013 10:07:59 AM Msg ID:  004607
From:  David Hempy Thread:  002593
Subject:  Re: CursorAdapter Object Reference Problem
THANK YOU!  :-)
 
I've been working around this for two days be restarting FoxWeb between compiles. I wish I'd looked here sooner!
 
-dave
 
--
David Hempy
Director of Broadcast and Educational Technology
Kentucky Educational Television
(859)258-7164 - (800)333-9764
Sent by FoxWeb Support on 06/13/2005 03:53:12 PM:
I believe you need to also release the class:
 
...
loOLBids = .F.
RELEASE loOLBids
CLEAR CLASS caOLBids
RETURN
 

FoxWeb Support Team
support@foxweb.com email

Sent by Michael Wheat on 06/13/2005 08:41:21 AM:
Hi FoxWeb Support Team,
 
If I create a Cursor Adapter Object based on my subclass. When I try to compile the other prg that the class is in, I get the following error.
 
Error while compiling c:\program files\foxweb\programs\olbproc.prg: File cannot be closed because outstanding references exist. (1184)
The following is the code used to create the object.
What am I doing wrong that does not destroy the object reference?
 
loOLBids = NEWOBJECT("caOLBids")
if VARTYPE(loOLBids) != "L"
 if loOLBids.CursorFill()
  Response.Write([CursorFill() Success])
 else
  Response.Write([CursorFill() Failed])
 endif
else
 Response.Write([Connect Failed])
endif
loOLBids = .F.
RELEASE loOLBids
RETURN
 
***************************************************************
* OLBids CursorAdapter
***************************************************************
DEFINE CLASS caOLBids AS CursorAdapter
  cConnStr = "DRIVER={MySQL ODBC 3.51 Driver};" +;
    "DESC=;DATABASE=****;" +;
    "SERVER=****;" +;
    "UID=****;PASSWORD=****;PORT=****;"+;
    "OPTION=3;STMT;"
  SelectCmd          = "SELECT * FROM OLBIDS"
  Tables             = "OLBIDS"
  KeyFieldList       = "OLBRECID"
  UpdatableFieldList = "OLBRECID, STKNO, BUYCODE, SALEDATE, BIDDATETIME, BIDAMT, CURRBID, TYPE"
  UpdateNameList = ;
    "OLBRecId OLBids.OLBRecId,"+;
    "StkNo OLBids.Stkno,"+;
    "BuyCode OLBids.BuyCode,"+;
    "SaleDate OLBids.SaleDate,"+;
    "BidDateTime OLBids.BidDateTime,"+;
    "BidAmt OLBids.BidAmt,"+;
    "CurrBid OLBids.CurrBid,"+;
    "Type OLBids.Type"
  Alias              = "OLBIDS"
  BufferModeOverride = 5
  DataSourceType     = "ODBC"
  FUNCTION Init() AS Boolean
    LOCAL lnConn AS Integer
    SET MULTILOCKS ON
    lnConn = SQLSTRINGCONNECT(This.cConnStr)
    IF lnConn > 0
      This.DataSource = lnConn
    ENDIF
    lnConn = NULL
    RETURN This
  ENDFUNC
  FUNCTION Destroy()
    IF This.DataSource > 0
      SQLDISCONNECT(This.DataSource)
    ENDIF
    This.DataSource = NULL
    RETURN DODEFAULT()
  ENDFUNC
ENDDEFINE
 
 
Thank you,
Mike