by caducca » Sun Mar 11, 2018 2:06 am
Este es el código que uso:
Public oBrw
oQryTar := oServer:Query( "SELECT * FROM tarjeta ORDER BY Id" )
DEFINE FONT oFont NAME "Times New Roman" SIZE 0, -12
DEFINE FONT oFont18 NAME "Times New Roman" SIZE 0, -18 BOLD
DEFINE DIALOG oDlg SIZE 900,500 PIXEL TRUEPIXEL
DEFINE BUTTONBAR oBarC OF oDlg SIZE 56,56 2013
@ 70,20 XBROWSE oBrwC SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE oQryTar ;
COLUMNS ;
"Id", ;
"tar_nombre" ;
COLSIZES 100,600 ;
HEADERS "Id Tarj.", "Nombre Tarjeta" ;
CELL LINES NOBORDER AUTOCOLS
WITH OBJECT oBrwC
:lSeekBar := .T.
:bClrEdits := { || { CLR_HRED, CLR_YELLOW } }
:lAutoSort := .T.
:l2013 := .T.
:CreateFromCode()
END
oBarC:bPainted := { || oBarC:SayText( "Listado de Tarjetas", ;
{ nil, nil, nil, -50 }, "R", oFont18, CLR_HRED ) }
BrwBarBtnsF( oBarC, oBrwC )
ACTIVATE DIALOG oDlg CENTERED
oFont18:End()
oFont:End()
Return Nil
//-------------------------------------------------------------------------//
FUNCTION BrwBarBtnsF( oBar, oBrw )
Local n := 1, cBuscaB:=Space(30)
DEFINE BUTTON OF oBar FILE ".\BMP\Anterior.PNG" PROMPT "Primero" TOOLTIP "Ir al Primero" ;
ACTION Nada() // ( oBrw:GoTop(), oBrw:SetFocus() )
DEFINE BUTTON OF oBar FILE ".\BMP\Buscar.PNG" PROMPT "Buscar" TOOLTIP "Buscar" ;
ACTION Nada()
DEFINE BUTTON OF oBar FILE ".\BMP\Siguiente.PNG" PROMPT "Ultimo" TOOLTIP "Ir al Ultimo" ;
ACTION Nada() // ( oBrw:GoBottom(), oBrw:SetFocus() )
DEFINE BUTTON OF oBar FILE ".\BMP\Agregar.PNG" PROMPT "Agergar" GROUP TOOLTIP "Agregar Registro" ;
ACTION CargaTarje(.T.)
DEFINE BUTTON OF oBar FILE ".\BMP\editar.PNG" PROMPT "Modificar" TOOLTIP "Modificar Registro" ;
ACTION CargaTarje(.F.) // nCodiAl:=oRsAlu:Id, EditAlum(.F.,nCodiAl))
DEFINE BUTTON OF oBar FILE ".\BMP\Borrar.PNG" PROMPT "Borrar" TOOLTIP "Borrar Registro" ;
ACTION Nada()
DEFINE BUTTON OF oBar FILE ".\BMP\Excel.PNG" PROMPT "Excel" GROUP TOOLTIP "Exportar a Excel" ;
ACTION Nada() // oBrw:ToExcel()
DEFINE BUTTON OF oBar FILE ".\BMP\Print.PNG" PROMPT "Imprimir" TOOLTIP "Imprimir Reporte" ;
ACTION Nada() // oBrw:Report()
DEFINE BUTTON OF oBar FILE ".\BMP\Salir2.PNG" PROMPT "Salir" GROUP TOOLTIP "Cerrar Ventana" ;
ACTION oBrw:oWnd:End()
Return Nil
//-------------------------------------------------------------------------//
FUNCTION CargaTarje(lAppend)
If lAppend
oQryTar:GetBlankRow(.F.)
Else
oQryTar:GetRow()
EndIf
DEFINE DIALOG oDlgT1 RESOURCE "DATOSTARJE"
REDEFINE GET oQryTar:tar_nombre ID 4004 OF oDlgT1
REDEFINE BTNBMP oBtnA ID 250 OF oDlgT1 MESSAGE "Graba el Cliente..." ;
FILE "./BMP/Grabar.BMP" PROMPT "Grabar" LEFT ;
ACTION (lSave:=.T., oDlgT1:End())
REDEFINE BTNBMP oBtnC ID 240 OF oDlgT1 MESSAGE "Cancela el Movimiento..." ;
FILE "./BMP/Cancelar.BMP" PROMPT "Cancelar" LEFT ;
ACTION oDlgT1:End()
ACTIVATE DIALOG oDlgT1 CENTERED
Lo probé con DBFs y funciona pero con Mysql y tDolphin me arroja el siguiente reusltado
pplication
===========
Path and name: D:\Programs\Tarjetas\Tarjetas.Exe (32 bits)
Size: 1,297,920 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20161218)
FiveWin version: FWHX 17.03
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.2, Build 9200
Time from start: 0 hours 0 mins 2 secs
Error occurred at: 10/03/2018, 23:06:05
Error description: Error BASE/1004 Message not found: FWMARIAROWSET:GETROW
Stack Calls
===========
Called from: .\source\function\HARBOUR.PRG => _CLSSETERROR( 247 )
Called from: .\source\internal\FWROWSET.PRG => FWMARIAROWSET:GETROW( 1180 )
Called from: D:\Programs\Tarjetas\PRG\tarjeabm.prg => CARGATARJE( 91 )
Called from: D:\Programs\Tarjetas\PRG\tarjeabm.prg => (b)BRWBARBTNSF( 72 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 665 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 901 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1848 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: D:\Programs\Tarjetas\PRG\tarjeabm.prg => TARJE( 49 )
Called from: D:\Programs\Tarjetas\PRG\tarjetas.prg => (b)MAIN( 123 )
Called from: .\source\classes\TRBTN.PRG => TRBTN:CLICK( 717 )
Called from: .\source\classes\TRBTN.PRG => TRBTN:LBUTTONUP( 917 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\TRBTN.PRG => TRBTN:HANDLEEVENT( 1575 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1036 )
Called from: D:\Programs\Tarjetas\PRG\tarjetas.prg => MAIN( 196 )