Estoy queriendo mostrar una consulta en un Xbrowse que defino en un recurso, pero me da un error. La misma consulta si la muestro con la función xbrowse funciona correctamente.
Seguramente algo básico estoy haciendo mal porque estoy comenzando con esto, por eso recurro a la buena predisposición del foro.
- Code: Select all Expand view RUN
oRs := TOleAuto():New("ADODB.Recordset")
oRs:Open(cSql,oCn)
DEFINE WINDOW oWnd1 MDICHILD TITLE "RESULTADO DE LA CONSULTA" OF oWnd NOZOOM ICON oIco
DEFINE BUTTONBAR oBar SIZE 60,60 OF oWnd1 2010
DEFINE BUTTON RESOURCE "EXCE" OF oBar TOOLTIP "Exportar a Excel" ;
ACTION oBrw:ToExcel() PROMPT "Exporta" TOP
DEFINE BUTTON RESOURCE "IMPR" OF oBar TOOLTIP "Imprimir Planilla" ;
ACTION oBrw:Report("Reporte",.T.,.F.) PROMPT "Reporte" TOP
DEFINE BUTTON RESOURCE "SALE" OF oBar TOOLTIP "Cerrar Ventana" ;
ACTION oWnd1:End() PROMPT "Cerrar" TOP
oWnd1:bGotFocus := { || oDlg:SetFocus}
oWnd1:bResized := { || Incrusta( oWnd1, oDlg, .t.) }
DEFINE DIALOG oDlg RESOURCE "ABMS" OF oWnd1
oBrw := TXBrowse():New()
REDEFINE XBROWSE oBrw ID 111 OF oDlg RECORDSET oRs AUTOCOLS AUTOSORT CELL
// Activo el dialogo y al iniciar muevo a 0,0
ACTIVATE DIALOG oDlg NOWAIT ON INIT oDlg:Move(0,0)
ACTIVATE WINDOW oWnd1 ON INIT Incrusta( oWnd1, oDlg, .T.)
El error que me genera al mostrar el dialogo es el siguiente
- Code: Select all Expand view RUN
- Application
===========
Path and name: F:\ado.exe (32 bits)
Size: 2,131,456 bytes
Compiler version: Harbour 3.1.0dev (Rev. 17114)
FiveWin Version: FWH 11.11
Windows version: 5.1, Build 2600 Service Pack 3
Time from start: 0 hours 0 mins 51 secs
Error occurred at: 22/05/2013, 11:55:42
Error description: (DOS Error -2147352567) WINOLE/1007 Argument error: RECORDCOUNT
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( 1665 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 11627 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3169 )
Called from: => SYSREFRESH( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:END( 508 )
Called from: .\source\function\ERRSYSW.PRG => (b)ERRORDIALOG( 407 )
Called from: .\source\classes\BUTTON.PRG => TBUTTON:CLICK( 157 )
Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT( 1653 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3169 )
Called from: => SENDMESSAGE( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND( 379 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 882 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 270 )
Called from: .\source\function\ERRSYSW.PRG => ERRORDIALOG( 426 )
Called from: .\source\function\ERRSYSW.PRG => (b)ERRORSYS( 31 )
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( 1665 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 11627 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3169 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 270 )
Called from: .\source\function\ERRSYSW.PRG => ERRORDIALOG( 426 )
Called from: .\source\function\ERRSYSW.PRG => (b)ERRORSYS( 31 )
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( 1665 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 11627 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3169 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 990 )
Called from: ADO.prg => MAIN( 51 )
Gracias de antemano por su colaboración