FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with xBrowse (Fixed)
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Problem with xBrowse (Fixed)
Posted: Tue May 16, 2023 04:39 AM
Mr. Rao:

I need your help again

Please watch this video, if you need more information just tell me



As we can see, after adding two records to the recordset we exit and when we reopen the program we get an error

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem with xBrowse
Posted: Tue May 16, 2023 04:48 PM

To be honest, I could not understand.

Can you please copy the error.log here please?

Regards



G. N. Rao.

Hyderabad, India
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Problem with xBrowse
Posted: Tue May 16, 2023 05:00 PM

Mr. Rao:

First, thank you for yor interest, here is the error log file.

If you prefer, give me an email address to send you a self-contained program

Application

===========

Path and name: C:\TestXbrw\TestXBrw.Exe (32 bits)

Size: 4,218,368 bytes

Compiler version: Harbour 3.2.0dev (r1904111533)

FiveWin version: FWH 20.12

C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)

Windows version: 6.2, Build 9200

Time from start: 0 hours 0 mins 8 secs

Error occurred at: 16/05/2023, 10:55:20

Error description: (DOS Error -2147352567) WINOLE/1007 El identificador de fila se refiri贸 a una fila eliminada o a una fila marcada para eliminar. (0x80040E23): Microsoft Cursor Engine

Stack Calls

===========

Called from: => TOLEAUTO:VALUE( 0 )

Called from: .\source\function\ADOFUNCS.PRG => FWADOFIELDSTRUCT( 2069 )

Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:SETCOLFROMADO( 7106 )

Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:SETADO( 6577 )

Called from: .\source\classes\XBROWSE.PRG => XBRWSETDATASOURCE( 17313 )

Called from: .\source\classes\XBROWSE.PRG => XBROWSENEW( 17095 )

Called from: Source\Test.Prg => TEST( 49 )

Called from: Source\TestXbrw.Prg => (b)LABARRA( 124 )

Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 713 )

Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 999 )

Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1817 )

Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 2051 )

Called from: .\source\classes\WINDOW.PRG => _FWH( 3559 )

Called from: => WINRUN( 0 )

Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1097 )

Called from: Source\TestXbrw.Prg => MAIN( 95 )

System

======

CPU type: AMD Ryzen 5 5500U with Radeon Graphics 2096 Mhz

Hardware memory: 15755 megs

Free System resources: 90 %

    GDI    resources: 90 %

    User   resources: 90 %

Windows total applications running: 5

  1 ,

  2 , C:\TestXbrw\TestXBrw.Exe

  3 , C:\WINDOWS\System32\shcore.dll

  4 , C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.1635_none_6ebca7

  5 GDI+ Window (AsusOSD.exe), C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.22621.1635_none_9fa79a41e294b9

Variables in use

================

Procedure Type Value

==========================

TOLEAUTO:VALUE

 Param   1:    O    Class: ERROR

FWADOFIELDSTRUCT

 Local   1:    U

 Local   2:    U

TXBROWSE:SETCOLFROMADO

 Param   1:    O    Class: TOLEAUTO

 Param   2:    O    Class: TOLEAUTO

 Local   1:    U

 Local   2:    U

 Local   3:    O    Class: TOLEAUTO

 Local   4:    N    133

 Local   5:    U

 Local   6:    C    "D"

 Local   7:    N    8

 Local   8:    N    0

 Local   9:    L    .T.

 Local  10:    S

 Local  11:    U

TXBROWSE:SETADO

 Param   1:    C    "HDR_FDM"

 Param   2:    L    .T.

 Param   3:    A    Len:   12

 Param   4:    L    .F.

 Param   5:    C    "MYSQL"

 Local   1:    O    Class: TXBROWSE

 Local   2:    A    Len:    2

 Local   3:    N    133

 Local   4:    U

 Local   5:    U

 Local   6:    U

 Local   7:    O    Class: TXBRWCOLUMN

 Local   8:    O    Class: TOLEAUTO

 Local   9:    U

 Local  10:    U

 Local  11:    U

 Local  12:    B    {|| ... }

XBRWSETDATASOURCE

 Param   1:    O    Class: TOLEAUTO

 Param   2:    L    .T.

 Param   3:    L    .T.

 Param   4:    A    Len:   10

 Local   1:    O    Class: TXBROWSE

 Local   2:    C    "MYSQL"

 Local   3:    N    10

 Local   4:    N    2

 Local   5:    O    Class: TXBRWCOLUMN

 Local   6:    A    Len:   12

 Local   7:    L    .F.

XBROWSENEW

 Param   1:    O    Class: TXBROWSE

 Param   2:    O    Class: TOLEAUTO

 Param   3:    L    .T.

 Param   4:    L    .T.

 Param   5:    A    Len:   10

 Param   6:    U

 Param   7:    A    Len:   10

 Param   8:    U

 Local   1:    C    "O"

 Local   2:    U

 Local   3:    L    .F.

TEST

 Param   1:    O    Class: TDIALOG

 Param   2:    N    0

 Param   3:    N    0

 Param   4:    U

 Param   5:    U

 Param   6:    U

 Param   7:    A    Len:   10

 Param   8:    A    Len:   10

 Param   9:    U

 Param  10:    U

 Param  11:    U

 Param  12:    U

 Param  13:    U

 Param  14:    U

 Param  15:    U

 Param  16:    U

 Param  17:    L    .F.

 Param  18:    O    Class: TOLEAUTO

 Param  19:    U

 Param  20:    L    .F.

 Param  21:    U

 Param  22:    L    .F.

 Param  23:    N    200

 Param  24:    L    .T.

 Param  25:    L    .F.

 Param  26:    A    Len:   10

 Param  27:    A    Len:    6

 Param  28:    A    Len:   10

 Param  29:    U

 Param  30:    L    .T.

 Param  31:    L    .F.

 Param  32:    L    .F.

 Param  33:    L    .F.

 Param  34:    U

 Param  35:    U

 Param  36:    U

 Param  37:    U

 Param  38:    L    .F.

 Param  39:    L    .F.

 Param  40:    C    "oBrw"

 Param  41:    U

 Local   1:    O    Class: TXBROWSE

 Local   2:    U

 Local   3:    U

 Local   4:    U

 Local   5:    U

(b)LABARRA

 Param   1:    O    Class: TMDIFRAME

 Local   1:    O    Class: TDIALOG

 Local   2:    U

 Local   3:    O    Class: TFONT

TBTNBMP:CLICK

 Param   1:    O    Class: TBTNBMP

TBTNBMP:LBUTTONUP

TCONTROL:HANDLEEVENT

 Param   1:    N    26

 Param   2:    N    27

 Param   3:    N    0

 Local   1:    L    .T.

 Local   2:    N    0

 Local   3:    S

TBTNBMP:HANDLEEVENT

 Param   1:    N    514

 Param   2:    N    0

 Param   3:    N    1703963

 Local   1:    U

_FWH

 Param   1:    N    514

 Param   2:    N    0

 Param   3:    N    1703963

WINRUN

 Param   1:    N    1703963

 Param   2:    N    514

 Param   3:    N    0

 Param   4:    N    1703963

 Param   5:    N    5

 Local   1:    O    Class: TBTNBMP

TMDIFRAME:ACTIVATE

 Param   1:    N    461008

MAIN

 Param   1:    C    "MAXIMIZED"

 Param   2:    U

 Param   3:    U

 Param   4:    U

 Param   5:    U

 Param   6:    B    {|| ... }

 Param   7:    U

 Param   8:    B    {|| ... }

 Param   9:    U

 Param  10:    U

 Param  11:    U

 Param  12:    U

 Param  13:    U

 Param  14:    U

 Param  15:    U

 Param  16:    U

 Param  17:    B    {|| ... }

 Param  18:    U

 Param  19:    U

 Param  20:    L    .F.

 Local   1:    O    Class: TMDIFRAME

 Local   2:    U

 Local   3:    U

Linked RDDs

===========

DBF

DBFFPT

DBFBLOB

DBFNTX

DataBases in use

================

Classes in use:

===============

 1 ERROR

 2 HBCLASS

 3 HBOBJECT

 4 TWINDOW

 5 TCONTROL

 6 TGET

 7 TAPLICACION

 8 TINI

 9 WIN_OLEAUTO

10 TOLEAUTO

11 TICON

12 TBRUSH

13 TMDIFRAME

14 TMENU

15 TREG32

16 TMENUITEM

17 TMDICLIENT

18 TFONT

19 TMSGBAR

20 TRECT

21 TMSGITEM

22 TTIMER

23 TBITMAP

24 TIMAGE

25 TCURSOR

26 TBAR

27 TBTNBMP

28 TMDICHILD

29 TDIALOG

30 TXBROWSE

31 TXBRWCOLUMN

32 TSCROLLBAR

33 TCLIPBOARD

34 TSTRUCT

Memory Analysis

===============

  598 Static variables

Dynamic memory consume:

  Actual  Value:    2031616 bytes

  Highest Value:    2031616 bytes
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Problem with xBrowse
Posted: Tue May 16, 2023 08:33 PM

Buenas Armando, c贸digo?

Called from: Source\Test.Prg => TEST( 49 )

Called from: Source\TestXbrw.Prg => (b)LABARRA( 124 ) bad linea.

??

Regards, saludos.

Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Problem with xBrowse
Posted: Wed May 17, 2023 01:04 AM
Joao:
Here is the main.Prg code
Code (fw): Select all Collapse
#include "FiveWin.Ch"
#include "Ado.ch"
#include "FileIO.ch"

#define cBorde 聽 聽 聽NOBORDER
#define nIcono 聽 聽 聽1

STATIC oWindow
STATIC oError
STATIC aVars := {NIL,NIL,NIL}


#xtranslate aBtns = > aVars\[ 1\]
#xtranslate aMenu = > aVars\[ 2\]
#xtranslate aSubM = > aVars\[ 3\]

MEMVAR oApp

// Para que los acentos se vean bien
REQUEST HB_LANG_ES
REQUEST HB_CODEPAGE_ESWIN

FUNCTION Main()
聽 聽LOCAL oIcono, oCursor, oCasilla, oBmp , oBrush

聽 聽LOCAL lStatus := ( .T. )

聽 聽LOCAL hWnd

聽 聽SET CENTURY ON
聽 聽SET DATE TO FRENCH
聽 聽SET DELETED ON
聽 聽SET OPTIMIZE ON
聽 聽SETBALLOON(.T.)

聽 聽HB_CDPSELECT("ESWIN")
聽 聽HB_LangSelect( "ESWIN" )

聽 聽FWSetLanguage( 2 ) 聽 聽 聽// Para poner el PREVIEW en Espa帽ol


// Para que los acentos se vean bien
聽 聽SET( _SET_CODEPAGE, "ESWIN" )

聽 聽SETHELPFILE( "ParCre.Hlp" )

// Para cambiar el color del get con foco
聽 聽TGet():lClrFocus := (.T.)
聽 聽TGet():nClrFocus := nRGB( 213, 219, 255 ) 聽 // Lila claro

聽 聽oApp := TAplicacion()

聽 聽LeeIni() 聽 聽 聽 聽 聽 聽 聽 // Lee parametros

聽 聽 hWnd := FindWindow( 0, oApp:cAplicacion + " " + oApp:cVersion + " " + oApp:cServer)

聽 聽IF hWnd != 0 .AND. ! oApp:lInstancia
聽 聽 聽 ShowWindow( hWnd, 3) //SW_MAXIMIZE=3 SW_NORMAL=1 SW_MINIMIZE=6
聽 聽 聽 QUIT
聽 聽ENDIF

聽 聽IF ! Conecta()
聽 聽 聽 QUIT
聽 聽ENDIF

聽 聽aBtns := ARRAY(05)

聽 聽aMenu := ARRAY(10)
聽 聽aSubM := ARRAY(05)

// 聽 LeeEmpresa( )

聽 聽DEFINE ICON oIcono RESOURCE "AppLogo"
聽 聽DEFINE BRUSH oBrush COLOR CLR_WHITE
聽 聽 DEFINE WINDOW oWindow MDI FROM 0, 0 TO 22, 75 TITLE oApp:cAplicacion + " " + oApp:cVersion + " " + oApp:cServer;
聽 聽 聽 MENU HazMenu() ICON oIcono BRUSH oBrush PIXEL MENUINFO 8

聽 聽SET MESSAGE OF oWindow TO oApp:cRazonSocial KEYBOARD CLOCK 2007

聽 聽IF ! EMPTY( oApp:cUsuario )
聽 聽 聽 DEFINE MSGITEM oCasilla OF oWindow:oMsgBar 聽 SIZE 120 ;
聽 聽 聽 PROMPT ALLTRIM( oApp:cUsuario ) COLOR CLR_BLACK, CLR_BLUE
聽 聽ENDIF

聽 聽DEFINE MSGITEM oCasilla OF oWindow:oMsgBar ;
聽 聽SIZE 85 ;
聽 聽 聽 PROMPT Date2Txt( DATE( ) )

聽 聽DEFINE MSGITEM oCasilla OF oWindow:oMsgBar ;
聽 聽SIZE 175 ;
聽 聽PROMPT oApp:cCopyRight

聽 聽oBmp = TImage():Define(,cFilePath(GetModuleFileName(GetInstance())) + "AppFondo.Jpg")
聽 聽 聽 oWindow:bPainted := {|hDC| PalBmpDraw( hDC, 0, 0,oBmp:hBitmap,, oWindow:nWidth, oWindow:nHeight,, (.T.)) }

聽 聽ACTIVATE WINDOW oWindow MAXIMIZED VALID Salir() ON INIT (LaBarra(oWindow), oWindow:Refresh())

聽 聽oIcono:End()
聽 聽oCasilla:End()
聽 聽oBmp:End()
聽 聽oBrush:End()
RETURN(.T.)

/*
* ---------------------------------------------------------------------------- *
*/
STATIC FUNCTION LaBarra( oWindow )
聽 聽LOCAL oBarra
聽 聽LOCAL oCursor

聽 聽DEFINE CURSOR oCursor RESOURCE "Dedo"
聽 聽DEFINE BUTTONBAR oBarra SIZE 45, 45 OF oWindow CURSOR oCursor 2007

聽 聽 聽 oBarra:bClrGrad = { | lInvert | If( ! lInvert,;
聽 聽 聽 聽 聽{ { 0.25, nRGB( 068, 097, 176 ), nRGB( 068, 097, 176 ) },;
聽 聽 聽 聽 聽{ 聽 0.75, nRGB( 068, 097, 176 ), nRGB( 068, 097, 176 ) } },;
聽 聽 聽 聽 聽{ { 0.25, nRGB( 255, 255, 255 ), nRGB( 255, 255, 255 ) },;
聽 聽 聽 聽 聽{ 聽 0.75, nRGB( 255, 255, 255 ), nRGB( 255, 255, 255 ) } } ) }

聽 聽 聽 oBarra:nClrText = { | lInvert | IF( ! lInvert, nRGB( 235, 160, 86 ), nRGB( 20, 20, 20 ) ) }

聽 聽* ------------------------------------------------------------------------- *

聽 聽DEFINE BUTTON aBtns[01] OF oBarra RESOURCE "Brw32" cBorde ;
聽 聽 聽 ACTION Test(oWindow )
聽 聽aBtns[01] :cToolTip := { "Test", "Test button", nIcono, oApp:cClrForTol, oApp:cClrBakTol }

聽 聽DEFINE BUTTON aBtns[02] OF oBarra RESOURCE "Exi32" cBorde ;
聽 聽 聽 GROUP ;
聽 聽 聽 ACTION oWindow:END( ) ;
聽 聽 聽 MESSAGE "Abandona el programa y retorna a windows"
聽 聽aBtns[02] :cToolTip := { "Salir", "Exit button", nIcono, oApp:cClrForTol, oApp:cClrBakTol }
RETURN (.T.)

/*
* ---------------------------------------------------------------------------- *
*/
STATIC FUNCTION HazMenu( )
聽 聽 LOCAL oMenu

聽 聽 MENU oMenu 2007
聽 聽 聽 聽 MENUITEM aMenu[01] PROMPT "&Test xBrowse"
聽 聽 聽 聽 聽 聽 MENU
聽 聽 聽 聽 聽 聽 MENUITEM aSubM[01] PROMPT "&Test";
聽 聽 聽 聽 聽 聽 聽 聽RESOURCE "Brw16" ;
聽 聽 聽 聽 聽 聽 聽 聽ACTION Test(oWindow )
聽 聽 聽 聽 聽 聽 SEPARATOR
聽 聽 聽 聽 聽 聽 MENUITEM aSubM[02] PROMPT "Salir 聽ALT-F4" ;
聽 聽 聽 聽 聽 聽 聽 聽RESOURCE "Exi16" ;
聽 聽 聽 聽 聽 聽 聽 聽ACTION oWindow:END( )
聽 聽 聽 聽 聽ENDMENU
聽 聽ENDMENU
RETURN(oMenu)


/*
* ---------------------------------------------------------------------------- *
*/
STATIC FUNCTION Salir( )
聽 聽IF MsgNoYes( "Seguro desea salir de la aplicaci贸n ?", oApp:cAplicacion )
聽 聽 聽 聽 oApp:oCon:Close()
聽 聽ELSE
聽 聽 聽 RETURN ( .F. )
聽 聽ENDIF
RETURN ( .T. )


/*
* ---------------------------------------------------------------------------- *
*/
STATIC FUNCTION LeeEmpresa( )
聽 聽LOCAL oRsEmp, oError

聽 聽oRsEmp := FW_OpenRecordSet(oApp:oCon,"SELECT " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "* " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"FROM " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "Empresa",adLockOptimistic,adOpenDynamic,0)

聽 聽IF oRsEmp == nil
聽 聽 聽 聽 MsgStop("No pude abrir la tabla EMPRESA !",oApp:cAplicacion)
聽 聽 聽 FW_ShowAdoError(oApp:oCon)
聽 聽 聽 RETURN(.F.)
聽 聽ENDIF

聽 聽IF oRsEmp:BOF( ) .AND. oRsEmp:EOF( )
聽 聽 聽 oApp:cRazonSocial := "Empresa no registrada, s.a. de c.v."
聽 聽ELSE
聽 聽 聽 oApp:cRazonSocial := oRsEmp:Fields( "EMP_NOM" ) :Value
聽 聽ENDIF

聽 聽IF oRsEmp <> NIL
聽 聽 聽 IF oRsEmp:State( ) = adStateOpen
聽 聽 聽 聽 聽oRsEmp:Close( )
聽 聽 聽 ENDIF
聽 聽ENDIF
RETURN( .T. )

/*
* ---------------------------------------------------------------------------- *
*/
FUNCTION Alinea( oReporte, Izq, Der, lTitle )
聽 聽DEFAULT lTitle 聽 := ( .T. )

聽 聽IF lTitle
聽 聽 聽 oReporte:oTitle:aRow[ Izq ] := oReporte:oTitle:aRow[ Der ]
聽 聽ELSE
聽 聽 聽 oReporte:oHeader:aRow[ Izq ] := oReporte:oHeader:aRow[ Der ]
聽 聽ENDIF
RETURN ( NIL )


/*
* ---------------------------------------------------------------------------- *
*/
FUNCTION OverFlow( oReporte )
聽 聽IF ( oReporte:nRow + ( oReporte:nStdLineHeight * 2 ) ) >= oReporte:nBottomRow
聽 聽 聽 oReporte:EndPage( )
聽 聽 聽 oReporte:StartPage( )
聽 聽ENDIF
RETURN NIL


/*
* ---------------------------------------------------------------------------- *
*/
CLASS TAplicacion
聽 聽DATA cUsuario 聽 聽 聽 聽INIT ""
聽 聽DATA cRazonSocial 聽 聽INIT "EMPRESA NO REGISTRADA, S.A. DE C.V."
聽 聽DATA cAplicacion 聽 聽 INIT "漏 " + STR( YEAR( DATE( ) ), 4, 0 ) + " XBrowse Test"// + SPACE(2) + FWVERSION
聽 聽DATA cAppAlias 聽 聽 聽 INIT "漏 " + STR( YEAR( DATE( ) ), 4, 0 ) + " ParCre"
聽 聽DATA cCopyRight 聽 聽 聽INIT "漏 2021-" + STR( YEAR( DATE( ) ), 4, 0 ) + " by S.O.I., s.a. de c.v."
聽 聽DATA cVersion 聽 聽 聽 聽INIT "Versi贸n 1.0M18"
聽 聽DATA nLineStyle 聽 聽 聽INIT 4

聽 聽DATA cPath 聽 聽 聽 聽 聽 INIT ""
聽 聽DATA cPathExe 聽 聽 聽 聽INIT cFilePath(GetModuleFileName(GetInstance())) 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽// C:\ParCre\
聽 聽DATA cCrypt 聽 聽 聽 聽 聽INIT "XrypT2023"

聽 聽// Estos par谩metros son para el servidor de MySql
聽 聽DATA oCon 聽 聽 聽 聽 聽 聽INIT NIL
聽 聽DATA oDsn 聽 聽 聽 聽 聽 聽INIT NIL
聽 聽DATA cDsn 聽 聽 聽 聽 聽 聽INIT NIL
聽 聽DATA cDescription 聽 聽INIT NIL
聽 聽DATA cServer 聽 聽 聽 聽 INIT NIL
聽 聽DATA cDBName 聽 聽 聽 聽 聽 聽INIT NIL
聽 聽DATA cDataBase 聽 聽 聽 INIT NIL
聽 聽DATA cUser 聽 聽 聽 聽 聽 INIT NIL
聽 聽DATA cPass 聽 聽 聽 聽 聽 INIT NIL
聽 聽DATA nPort 聽 聽 聽 聽 聽 INIT NIL
聽 聽DATA cStmt 聽 聽 聽 聽 聽 INIT ""
聽 聽DATA cDriveName 聽 聽 聽INIT ""

聽 聽DATA nRowsInt 聽 聽 聽 聽INIT 3

聽 聽 // Colores del dialogo
聽 聽DATA cBrush 聽 聽 聽 聽 聽INIT "Brush"

聽 聽// Colores de la pijama
聽 聽DATA nRowNonClr 聽 聽 聽INIT RGB( 255, 255, 255 )
聽 聽DATA nRowParClr 聽 聽 聽INIT RGB( 238, 246, 255 )

聽 聽// Colores para encabezados del browse
聽 聽DATA nHdrForClr 聽 聽 聽INIT RGB( 255, 255, 255 ) // Blanco
聽 聽DATA nHdrBckClr 聽 聽 聽INIT RGB( 000, 000, 000 ) // Negro

聽 聽DATA nFClrFocus 聽 聽 聽INIT RGB( 000, 000, 000 ) // Negro
聽 聽DATA nBClrFocus 聽 聽 聽INIT RGB( 000, 191, 255 ) // Az煤l, se ve bien

聽 聽DATA cClrForTol 聽 聽 聽INIT CLR_WHITE
聽 聽DATA cClrBakTol 聽 聽 聽INIT CLR_HBLUE
ENDCLASS


/*
* ------------------------------------------------------------------------ *
* ------------------------------------------------------------------------ *
*/
STATIC FUNCTION LeeIni()
聽 聽 LOCAL oIni

聽 聽 INI oIni FILE ".\ParCre.Ini"
聽 聽 聽 聽 GET oApp:cDsn聽 聽聽 聽 聽 聽 聽 聽SECTION "MYSQL"聽 聽 聽ENTRY "Dsn"聽 聽 聽 聽 聽 聽 聽OF oIni DEFAULT "TestXbrw"
聽 聽 聽 GET oApp:cDescription 聽 SECTION "MYSQL" 聽 聽 聽ENTRY "Description" 聽OF oIni DEFAULT "XBrowse Test"
聽 聽 聽 GET oApp:cServer 聽 聽 聽 聽SECTION "MYSQL" 聽 聽 聽ENTRY "Server" 聽 聽 聽 OF oIni DEFAULT "localhost"
聽 聽 聽 GET oApp:cDataBase 聽 聽 聽SECTION "MYSQL" 聽 聽 聽ENTRY "DataBase" 聽 聽 OF oIni DEFAULT ""
聽 聽 聽 GET oApp:cUser 聽 聽 聽 聽 聽SECTION "MYSQL" 聽 聽 聽ENTRY "User" 聽 聽 聽 聽 OF oIni DEFAULT "root"
聽 聽 聽 GET oApp:cPass 聽 聽 聽 聽 聽SECTION "MYSQL" 聽 聽 聽ENTRY "PassWord" 聽 聽 OF oIni DEFAULT "91502127"
聽 聽 聽 GET oApp:nPort 聽 聽 聽 聽 聽SECTION "MYSQL" 聽 聽 聽ENTRY "Port" 聽 聽 聽 聽 OF oIni DEFAULT 3306
聽 聽 聽 GET oApp:cDriveName 聽 聽 SECTION "MYSQL" 聽 聽 聽ENTRY "DriveName" 聽 聽OF oIni DEFAULT "Driver={MySQL ODBC 5.1 Driver}"
聽 聽 聽 GET oApp:cPath 聽 聽 聽 聽 聽SECTION "MYSQL" 聽 聽 聽ENTRY "Path" 聽 聽 聽 聽 OF oIni DEFAULT "C:\Program Files\MySQL\MySQL Server 5.1\bin\"
聽 聽 聽 GET oApp:cStmt 聽 聽 聽 聽 聽SECTION "MYSQL" 聽 聽 聽ENTRY "Statement" 聽 聽OF oIni DEFAULT ""
聽 聽 聽 GET oApp:cDBName 聽 聽 聽 聽SECTION "DATABASE" 聽 ENTRY "DBName" 聽 聽 聽 OF oIni DEFAULT "TestXBrw"
聽 聽ENDINI
RETURN( NIL )


/*
* ---------------------------------------------------------------------------- *
*/
STATIC FUNCTION Conecta( )
聽 聽LOCAL oError

聽 聽TRY
聽 聽 oApp:oCon := TOleAuto( ) :new( "adodb.connection" )
聽 聽CATCH oError
聽 聽MsgStop( "No se ha podido crear la conexi贸n al servidor !", oApp:cAplicacion )
聽 聽RETURN( .F. )
聽 聽END

聽 聽oApp:oCon:ConnectionString := ALLTRIM( oApp:cDriveName ) + ;
聽 聽 聽 ";Server=" + ALLTRIM( oApp:cServer ) + ;
聽 聽 聽 ";Port=" + STR( oApp:nPort ) + ;
聽 聽 聽 ";Database=" + ALLTRIM( oApp:cDataBase ) + ;
聽 聽 聽 ";User=" + ALLTRIM( oApp:cUser ) + ;
聽 聽 聽 ";Password=" + ALLTRIM( oApp:cPass ) + ;
聽 聽 聽 ";Option=3;"


聽 聽oApp:oCon:CommandTimeout 聽 聽 聽:= 1800 聽 聽 // 30 Minutos * 60 segundos
聽 聽oApp:oCon:ConnectionTimeout 聽 := 28800 聽 聽// 聽8 horas * 360 segundos

聽 聽TRY
聽 聽 聽 oApp:oCon:Open()
聽 聽 聽 oApp:oCon:Execute( "SET SESSION wait_timeout = 86400;" )
聽 聽CATCH oError
聽 聽 聽 MsgInfo( "No se pudo lograr la conexi贸n al servidor, REVISE LA CONEXION DE SU RED O LA CONEXION A INTERNET !" + CRLF +;
聽 聽 聽 聽 聽 聽 聽 聽oApp:oCon:ConnectionString, oApp:cAplicacion )
聽 聽 聽 FW_ShowAdoError(oApp:oCon)
聽 聽 聽 RETURN( .F. )
聽 聽END
RETURN( .T. )

And. here is the Test.Prg code, this creates the HDRVDA table in Test Database and add two records,
So far so good, the recrods are displayed in the main browser, but when you exit Test.Prg and re-enter it throws the error.
We can see the problem in the video above

Code (fw): Select all Collapse
#Include "FiveWin.ch"
#Include "Ado.ch"
#Include "xbrowse.ch"

MEMVAR oApp

STATIC oWnd
STATIC oRsHdr

STATIC oBtns

FUNCTION Test(oWindow)
聽 聽LOCAL oDlg,oBrw,oFont

聽 聽 oBtns聽 聽聽 聽 := ARRAY(05)

聽 聽CreateDB()
聽 聽OpenTable()

聽 聽 DEFINE FONT oFont NAME "MS Sans Serif" SIZE 0,-10
聽 聽 DEFINE ICON oIcono RESOURCE "AppLogo"
聽 聽 DEFINE WINDOW oWnd MDICHILD OF oWindow FROM 0,0 TO 10,10;
聽 聽 聽 聽 TITLE "Relaci贸n de movimientos de almac茅n" ICON oIcono

聽 聽 聽 聽 oWnd:bGotFocus 聽= { || oBrw:SetFocus() }

聽 聽 聽 聽 DEFINE DIALOG oDlg RESOURCE "BrwVda" OF oWnd FONT oFont ICON oIcono

聽 聽 聽 聽 聽REDEFINE BUTTONBAR oBar ID 100 OF oDlg SIZE 56,42 2007

聽 聽 聽 聽 聽 聽 DEFINE BUTTON oBtns[01] OF oBar ;
聽 聽 聽 聽 聽 聽 聽 聽RESOURCE "Add16" TOP NOBORDER;
聽 聽 聽 聽 聽 聽 聽 聽PROMPT "&Agregar";
聽 聽 聽 聽 聽 聽 聽 聽ACTION InsertMovs(oBrw)

聽 聽 聽 聽 聽 聽 DEFINE BUTTON oBtns[04] OF oBar ;
聽 聽 聽 聽 聽 聽 聽 聽ACTION oWnd:End();
聽 聽 聽 聽 聽 聽 聽 聽RESOURCE "Exi16" TOP NOBORDER;
聽 聽 聽 聽 聽 聽 聽 聽PROMPT "&Salir";
聽 聽 聽 聽 聽 聽 聽 聽GROUP

聽 聽 聽 聽 聽 聽 REDEFINE XBROWSE oBrw ID 200 OF oDlg;
聽 聽 聽 聽 聽 聽 聽 聽 DATASOURCE oRsHdr;
聽 聽 聽 聽 聽 聽 COLUMNS "HDR_FOL","HDR_FDM","HDR_REF","","","","","","SUC_NOM","HDR_CAN";
聽 聽 聽 聽 聽 聽 聽 聽 HEADERS "Folio","Fecha","Referencia","Tipo","Unidades","Costos","Unidades","Costos","Sucursal","Can";
聽 聽 聽 聽 聽 聽 聽 聽 COLSIZES 50,80,80,60,70,75,70,75,110,32;
聽 聽 聽 聽 聽 聽 聽 聽 PICTURES "@Z 9999999","dd/mmm/yyyy",Nil,Nil,"@Z 9,999,999","@Z 99,999,999.99","@Z 9,999,999","@Z 99,999,999.99",Nil,Nil;
聽 聽 聽 聽 聽 聽 聽 聽 JUSTIFY {AL_RIGHT,AL_RIGHT,AL_LEFT,AL_LEFT,AL_RIGHT,AL_RIGHT,AL_RIGHT,AL_RIGHT,AL_LEFT,AL_CENTER};
聽 聽 聽 聽 聽 聽 聽 聽 FOOTERS AUTOSORT //BACKGROUND oApp:cBrush

聽 聽 聽 聽 聽 聽 聽 聽 WITH OBJECT oBrw
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :l2007 聽 聽 聽 聽 聽 聽:= (.F.)
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :lHScroll 聽 聽 聽 聽 := (.F.)
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :lVScroll 聽 聽 聽 聽 := (.F.)
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :nMarqueeStyle 聽 聽:= MARQSTYLE_HIGHLROW
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :nColDividerStyle := LINESTYLE_LIGHTGRAY
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :nRowDividerStyle := LINESTYLE_LIGHTGRAY
聽 聽 聽 聽 聽 聽 聽 聽:SetGroupHeader( "E N T R A D A S",05,06 )
聽 聽 聽 聽 聽 聽 聽 聽:SetGroupHeader( "S A L I D A S",07,08 )
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :nHeaderHeight聽 聽 聽 := 25
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :nRowHeight聽聽 聽 聽 聽 := 22
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :nFooterHeight聽 聽 聽 := 25
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :bClrHeader 聽 聽 聽 := { || {CLR_WHITE,CLR_BLACK} }
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :bClrFooter 聽 聽 聽 := { || {CLR_WHITE,CLR_BLACK} }
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :bClrSel 聽 聽 聽 聽 聽:= { || IF( oBrw:KeyNo % oApp:nRowsInt == 0 ,{ CLR_BLACK, oApp:nRowParClr },{ CLR_BLACK, oApp:nRowNonClr }) }
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :bClrSelFocus 聽 聽 := { || {oApp:nFClrFocus,oApp:nBClrFocus} }
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :bClrStd 聽 聽 聽 聽 聽:= { || IF( oBrw:KeyNo % oApp:nRowsInt == 0 ,{ CLR_BLACK, oApp:nRowParClr },{ CLR_BLACK, oApp:nRowNonClr }) }
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :nRecSelColor 聽 聽 := oApp:nRowParClr
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :lDisplayZeros 聽 聽:= (.F.)

聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 WITH OBJECT :Folio
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :cOrder聽:= "A"
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 END

聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 WITH OBJECT :Tipo
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :bStrData 聽聽聽 聽 聽 聽 := { || IF(oRsHdr:RecordCount() > 0 .AND.;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 oRsHdr:Fields("HDR_EOS"):Value == 1,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "Entrada","Salida")}
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :nHeadStrAlign聽 := AL_LEFT
聽 聽 聽 聽 聽 聽 聽 聽END

聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 WITH OBJECT :aCols[05]
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :bStrData 聽聽聽 聽 聽 聽 := { || IF(oRsHdr:RecordCount() > 0 .AND.;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 oRsHdr:Fields("HDR_EOS"):Value == 1,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Transform(oRsHdr:Fields("HDR_TOU"):Value,"@Z 9,999,999"),"")}
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :nHeadStrAlign聽 := AL_RIGHT
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 END

聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 WITH OBJECT :aCols[06]
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :bStrData 聽聽聽 聽 聽 聽 := { || IF(oRsHdr:RecordCount() > 0 .AND.;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 oRsHdr:Fields("HDR_EOS"):Value == 1,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Transform(oRsHdr:Fields("HDR_TOC"):Value,"@Z 99,999,999.99") ,"")}
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :nHeadStrAlign聽 := AL_RIGHT
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 END

聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 WITH OBJECT :aCols[07]
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :bStrData 聽聽聽 聽 聽 聽 := { || IF(oRsHdr:RecordCount() > 0 .AND.;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 oRsHdr:Fields("HDR_EOS"):Value == 2,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Transform(oRsHdr:Fields("HDR_TOU"):Value,"@Z 9,999,999"),"")}
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :nHeadStrAlign聽 := AL_RIGHT
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 END

聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 WITH OBJECT :aCols[08]
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :bStrData 聽聽聽 聽 聽 聽 := { || IF(oRsHdr:RecordCount() > 0 .AND.;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 oRsHdr:Fields("HDR_EOS"):Value == 2,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Transform(oRsHdr:Fields("HDR_TOC"):Value,"@Z 99,999,999.99") ,"")}
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :nHeadStrAlign聽 := AL_RIGHT
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 END

聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 WITH OBJECT :aCols[10]
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :SetLogical()
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 :SetCheck(NIL,(.T.))
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 END
聽 聽 聽 聽 聽 聽 聽 聽 END

聽 聽 聽 聽 ACTIVATE DIALOG oDlg NOWAIT ON INIT oDlg:MOVE(0,0) VALID ! GetASyncKey(VK_ESCAPE)
聽 聽 ACTIVATE WINDOW oWnd ON INIT (oWnd:SETSIZE(oDlg:nWidth+15,oDlg:nHeight+29),oBrw:SetFocus) VALID CloseTable()

聽 聽 oFont:END()
聽 聽 oIcono:END()
RETURN(.T.)


* ---------------------------------------------------------------------------- *
STATIC FUNCTION CreateDB()
聽 聽LOCAL cCmdSql 聽 聽 聽 聽 聽 := NIL

聽 聽oApp:oCon:Execute("USE Test")

聽 聽cCmdSql := "CREATE TABLE IF NOT EXISTS HdrVda (" +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 "HDR_FOL INTEGER(03) 聽NOT NULL 聽 聽AUTO_INCREMENT 聽 聽COMMENT 'Folio'," +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 "HDR_EOS DECIMAL(01,0) 聽NOT NULL DEFAULT 0 聽 聽 聽 聽 聽 聽COMMENT 'E=Entrada y S=Salida'," +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 "HDR_SUC DECIMAL(03,0) 聽 聽 聽NULL 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽COMMENT 'N煤mero de sucursal'," +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 "HDR_FDM DATE 聽 聽 聽 聽 聽 NOT NULL DEFAULT '0000-00-00' COMMENT 'Fecha del movimiento'," +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 "HDR_REF VARCHAR(15) 聽 聽NOT NULL DEFAULT '' 聽 聽 聽 聽 聽 COMMENT 'Referencia'," +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 "HDR_TOU DECIMAL(05,0) 聽NOT NULL DEFAULT 0 聽 聽 聽 聽 聽 聽COMMENT 'Total de unidades'," +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 "HDR_TOC DECIMAL(11,2) 聽NOT NULL DEFAULT 0.00 聽 聽 聽 聽 COMMENT 'Total de costos'," +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 "HDR_CAN BIT 聽 聽 聽 聽 聽 聽NOT NULL DEFAULT 0 聽 聽 聽 聽 聽 聽COMMENT 'Cancelado ?'," +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 "HDR_MOT VARCHAR(50) 聽 聽NOT NULL DEFAULT '' 聽 聽 聽 聽 聽 COMMENT 'Motivo de la cancelaci贸n'," +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 "PRIMARY KEY(HDR_FOL))" +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 "ENGINE = InnoDB 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽COMMENT 'Encabezado de vales de almac茅n';"

聽 聽oApp:oCon:Execute(cCmdSql)

RETURN(.T.)

* ---------------------------------------------------------------------------- *
STATIC FUNCTION OpenTable()
聽 聽oRsHdr := FW_OpenRecordSet(oApp:oCon,"SELECT " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "*," +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "SUC_NOM " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"FROM " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "HdrVda " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"LEFT JOIN " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "Sucursales " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"ON " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "HDR_SUC = Sucursales.SUC_NUM",adLockOptimistic,adOpenDynamic,0)

聽 聽IF oRsHdr == nil
聽 聽 聽 聽 MsgStop("I can't open the table HDRVDA !",oApp:cAplicacion)
聽 聽 聽 聽 FW_ShowAdoError(oApp:oCon)
聽 聽 聽 RETURN(.F.)
聽 聽ENDIF

聽 聽 IF oRsHdr:BOF() .AND. oRsHdr:EOF()
聽 聽 ELSE
聽 聽 聽 oRsHdr:MoveFirst()
聽 聽 ENDIF
RETURN(.T.)

* ---------------------------------------------------------------------------- *
STATIC FUNCTION InsertMovs(oBrw)
聽 聽oRsHdr:AddNew()
聽 聽oRsHdr:Fields("HDR_EOS"):Value 聽 := 1 聽 聽 聽 聽 聽 // In
聽 聽oRsHdr:Fields("HDR_SUC"):Value 聽 := AdoNull() 聽 // Only out movs has value
聽 聽oRsHdr:Fields("HDR_FDM"):Value 聽 := Date()
聽 聽oRsHdr:Fields("HDR_TOU"):Value 聽 := 10
聽 聽oRsHdr:Fields("HDR_TOC"):Value 聽 := 175.25
聽 聽oRsHdr:UpDate()

聽 聽oRsHdr:AddNew()
聽 聽oRsHdr:Fields("HDR_EOS"):Value 聽 := 2 聽 聽 聽 聽 聽 // Out
聽 聽oRsHdr:Fields("HDR_SUC"):Value 聽 := 1 聽 聽 聽 聽 聽 // Only out movs has value
聽 聽oRsHdr:Fields("HDR_FDM"):Value 聽 := Date()
聽 聽oRsHdr:Fields("HDR_REF"):Value 聽 := "F-254"
聽 聽oRsHdr:Fields("HDR_TOU"):Value 聽 := 150
聽 聽oRsHdr:Fields("HDR_TOC"):Value 聽 := 15000.00
聽 聽oRsHdr:UpDate()

聽 聽oRsHdr:ReQuery()

聽 聽oBrw:Refresh()
聽 聽oBrw:SetFocus()
RETURN(.T.)


* ---------------------------------------------------------------------------- *
*/
STATIC FUNCTION CloseTable()
聽 聽 oWnd聽 聽 聽 聽 := NIL

聽 聽 IF oRsHdr <> NIL
聽 聽 聽 聽 IF oRsHdr:State() = adStateOpen
聽 聽 聽 聽 聽 聽 oRsHdr:Close()
聽 聽 聽 聽 ENDIF
聽 聽 ENDIF
RETURN(.T.)
Best regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem with xBrowse
Posted: Wed May 17, 2023 12:55 PM

Just before the definition of xbrowse, please ensure that the oRs is open and not empty and set oRs:MoveFirst().

Regards



G. N. Rao.

Hyderabad, India
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Problem with xBrowse
Posted: Wed May 17, 2023 03:44 PM

Mr. Rao:

I have reviewed the code and before defining the browse there are two functions

CreateDB()

OpenTable()

.......

.......

Here I define the Browse

Regards

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Problem with xBrowse
Posted: Thu May 18, 2023 08:36 PM

Mr Rao:

Any clue?

Regards

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Problem with xBrowse
Posted: Wed May 24, 2023 04:09 PM

Mr. Rao:

There is no time to help us?

Best regards

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem with xBrowse
Posted: Sun May 28, 2023 01:59 AM
This is the error you got:
Code (fw): Select all Collapse
Error description: (DOS Error -2147352567) WINOLE/1007 El identificador de fila se refiri贸 a una fila eliminada o a una fila marcada para eliminar. (0x80040E23): Microsoft Cursor Engine

Stack Calls
===========
Called from: => TOLEAUTO:VALUE( 0 )
English Translation:
Code (fw): Select all Collapse
Error description: (DOS Error -2147352567) WINOLE/1007 The row identifier referred to a deleted row or a row marked for deletion. (0x80040E23): Microsoft Cursor Engine
This kind of error arises in cases like this:
Code (fw): Select all Collapse
聽 聽local oCn, oRs, oField

聽 聽oCn 聽 := FW_MSSQLDB()
聽 聽oRs 聽 := FW_OpenRecordSet( oCn, "states" )
聽 聽oRs:Delete()
聽 聽oField 聽 := oRs:Fields( 0 )
聽 聽? oField:Value // error 1007
This is the error:
Code (fw): Select all Collapse
聽 聽Error description: (DOS Error -2147352567) WINOLE/1007 聽Row handle referred to a deleted row or a row marked for deletion. (0x80040E23): Microsoft Cursor Engine

Stack Calls
===========
聽 聽Called from: 聽=> TOLEAUTO:VALUE( 0 )
1007 group of errors occur when accessing a recordset is closed or eof/bof is true or record is deleted.
Please check if any situation exists
Regards



G. N. Rao.

Hyderabad, India
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Problem with xBrowse
Posted: Sun May 28, 2023 02:37 AM

Mr. Rao:

Thank you for you help.

I have checked and there is no situation like the one you mention, in fact there is no DELETE code

Above you can see all the code and all the error.log file.

the first time I enter with the empty table, the two records are added

, one input and the next output, and they are displayed in the browse without problem.

When leaving and returning to continue increasing more records, the browse throws the problem

More data, I am simulating movements in a warehouse, inputs and outputs, at the outputs

You must fill in the HDR_SUC field that contains the number of the destination branch, it is not the

In the case of entries, there is no destination branch, for this reason the field is Null

The funny thing is that just reversing the order in which the records are written, output first and

after input, everything works fine.

Also, if I remove the LEFT JOIN everything works fine.

I hope you can help me, I'm going crazy

Best regards, thank you again

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem with xBrowse
Posted: Sun May 28, 2023 03:48 AM
oApp:oCon:Execute("USE Test")
What does this do?
Forgive my ignorance.
Is there a MySql command like "USE test"?
Regards



G. N. Rao.

Hyderabad, India
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Problem with xBrowse
Posted: Sun May 28, 2023 03:57 AM

Mr. Rao:

Yes, USE is a mysql command, after this command all commands affect tables in TEST database

Best regards

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem with xBrowse
Posted: Sun May 28, 2023 04:24 AM
Armando wrote:Mr. Rao:

Yes, USE is a mysql command, after this command all commands affect tables in TEST database

Best regards
Oh Sorry, yes. Pardon my forgetfulness.
It selects TEST as current database.

I am now copying your program with minor changes and trying to execute at my end.

BTW, it is now about 10:30 pm in Toluca. Are you still awake?
Regards



G. N. Rao.

Hyderabad, India
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Problem with xBrowse
Posted: Sun May 28, 2023 04:35 PM
Mr. Rao:
Oh Sorry, yes. Pardon my forgetfulness.
It selects TEST as current database.
Don't worry!
I am now copying your program with minor changes and trying to execute at my end.
Thanks a lot
BTW, it is now about 10:30 pm in Toluca. Are you still awake?
Yeah I'm up for a couple more hours, got a lot of work

With best regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero