help with XBROWSE and ADO

help with XBROWSE and ADO

Postby damianodec » Mon Mar 06, 2017 4:50 pm

hi guys,
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
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: help with XBROWSE and ADO

Postby nageswaragunupudi » Mon Mar 06, 2017 5:05 pm

Code: Select all  Expand view
           REDEFINE BTNBMP BtnEsc ID 01 OF oDlg2            ;
                ACTION (trovafortp(@oRs,@oCn,@Tuple,@lUno,@m_g110),  ;
                             oBrw:oRs := oRs, oBrw:GoTop(),  oDlg2:Refresh(), oBrw:Refresh() )            
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: help with XBROWSE and ADO

Postby damianodec » Tue Mar 07, 2017 7:21 am

it work!

thank you nageswaragunupudi!!!
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: help with XBROWSE and ADO

Postby damianodec » Tue Mar 07, 2017 7:34 am

Another question:
in function trovafortp(oRs,oCn,tuple,lUno,m_g110,oBrw) should I close the oRs connection and then oRs := FW_OpenRecordSet( oCn, tuple, 1 )?

thank...

Damiano
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 58 guests