with function trovafortp() I get my recordset and then it' ok in REDEFINE BROWE oBrw. then I would like to change my search with m_g110 and press ok(ID 01) but
oBrw not change and get error.
this is my code:
- Code: Select all Expand view
oCn := FW_OpenAdoConnection( Connessione, .t.)
trovafortp(@oRs,@oCn,@Tuple,@lUno,@m_g110)
DEFINE FONT oFont NAME "Courier new" SIZE 0, -12
DO WHILE sw1
if oRs <> Nil
DEFINE DIALOG oDlg2 RESOURCE "ANAGRA" FONT oFont
REDEFINE GET o_g110 VAR m_g110 ID 110 OF oDlg2 ;
PICTURE "@ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
REDEFINE XBROWSE oBrw CELL LINES RECORDSET oRs ID 101 OF oDlg2
REDEFINE BTNBMP BtnEsc ID 01 OF oDlg2 ;
ACTION (trovafortp(@oRs,@oCn,@Tuple,@lUno,@m_g110),oBrw:Update(), oDlg2:Refresh())
REDEFINE BTNBMP BtnEsc ID 11 OF oDlg2 ;
ACTION (oRs:Close(), sw1 := .f., oDlg2:End())
ACTIVATE dialog oDlg2
else
msginfo("tuple errata")
endif
Enddo
Return Nil
function trovafortp(oRs,oCn,tuple,lUno,m_g110,oBrw)
tuple := "Select FIEDL1 as CUST, DESFIELD as DESC "+;
"FROM FILE "+;
"WHERE FIELD2 >= '"+m_g110+"' "+;
"ORDER BY DESC "
oRs := FW_OpenRecordSet( oCn, tuple, 1 )
if oRs = Nil
msginfo("ERROR")
endif
Return Nil
and this is error:
Application
===========
Path and name: C:\MyEXE.exe (32 bits)
Size: 2,093,056 bytes
Compiler version: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 9421)
FiveWin Version: FWHX 11.12
Windows version: 6.2, Build 9200
Time from start: 0 hours 0 mins 13 secs
Error occurred at: 06-03-2017, 15:35:55
Error description: Error ADODB.RecordSet/6 DISP_E_UNKNOWNNAME: RECORDCOUNT
Args:
Stack Calls
===========
Called from: => TOLEAUTO:RECORDCOUNT( 0 )
Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE:SETADO( 4277 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT( 1381 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DISPLAY( 1250 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1666 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 11627 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3159 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 270 )
Called from: trovafor.prg => TROVAFOR( 40 )
....
thank for your reply.
Damiano