FW_OpenRecordSet and NOWAIT dialog
Posted: Tue Oct 26, 2021 8:36 am
Hi,
I have this problem
I call this program from my menu and xBrowse works in DIALOG (FIRST CALL)
then I open again this program BY MENU and xBrowse works too (SECOND CALL)
then I close the first progr (FIRST CALL) by BtnEsc and when I press ok on second program I get:
Stack Calls
===========
Called from: => TOLEAUTO:RECORDCOUNT( 0 )
Called from: .\source\classes\XBROWSE.PRG => ADOSKIP( 10092 )
Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE:SETADO( 5590 )
function schart01Esci close oCn that is a local variable inside (FIRST CALL) but it also closes the second connection in (SECOND CALL)
Why?
How can I resolve it ?
Thank you
I have this problem
Code: Select all | Expand
...
local oCn := ""
...
oCn := FW_OpenAdoConnection( "connection data...", .t.)
oRs := FW_OpenRecordSet( oCn, "Select...", 1 )
DEFINE DIALOG oDlg RESOURCE "SCHEDA1" OF oWnd FONT oFont TITLE "Scheda"
...
REDEFINE XBROWSE oBrw ;
RECORDSET oRs;
REDEFINE BTNBMP BtnOk ID 1 OF m_get[32] RESOURCE "ok" 2007 ;
ACTION (schart01Ok(cGo))
REDEFINE BTNBMP BtnEsc ID 2 OF m_get[32] RESOURCE "chiudi" 2007 ;
ACTION schart01Esci(@oCn,@oWnd)
ACTIVATE DIALOG m_get[32] CENTERED NOWAIT
*-----------------------------------------------------------------------------------
FUNCTION schart01Esci(m_get, o_get, oCn, oWnd)
m_get[32]:End()
oCn:Close()
Return NIL
I call this program from my menu and xBrowse works in DIALOG (FIRST CALL)
then I open again this program BY MENU and xBrowse works too (SECOND CALL)
then I close the first progr (FIRST CALL) by BtnEsc and when I press ok on second program I get:
Stack Calls
===========
Called from: => TOLEAUTO:RECORDCOUNT( 0 )
Called from: .\source\classes\XBROWSE.PRG => ADOSKIP( 10092 )
Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE:SETADO( 5590 )
function schart01Esci close oCn that is a local variable inside (FIRST CALL) but it also closes the second connection in (SECOND CALL)
Why?
How can I resolve it ?
Thank you