Ayuda con un xBrowse (SOLUCIONADO)

Ayuda con un xBrowse (SOLUCIONADO)

Postby Armando » Sun Jul 08, 2018 10:59 pm

Mr. Rao y Amigos del Foro:

Now I have a Little problem with xBrowse, I have this code
Ahora tengo un pequeño problema con un xBrowse,en el siguiente código:

Code: Select all  Expand view

// I create a table
// Creamos la tabla
    cCmdSql := "CREATE TABLE IF NOT EXISTS Cuentas (" +;
                    "CUE_CUE DECIMAL(10,0)  NOT NULL    DEFAULT 0               COMMENT 'Número de cuenta'," +;
                    "CUE_DES CHAR(35)           NOT NULL    DEFAULT ''              COMMENT 'Nombre o descripción del banco'," +;
                    "PRIMARY KEY(CUE_CUE))" +;
                    "ENGINE = InnoDB                                                    COMMENT 'Cuentas bancarias';"

…….
…….
……

// I show the recordset in this xBrowse
// Muestro el recordset en el xBrowse

            REDEFINE XBROWSE oBrw ID 200 OF oDlg;
                DATASOURCE oRsCta ;
                COLUMNS "CUE_DES", "CUE_CUE" ;
                HEADERS "Descripción", "Número";
                COLSIZES 150,50 ;
                FOOTERS AUTOSORT

                FWNumFormat( "A", (.T.) )

                WITH OBJECT oBrw
                :l2007            := (.F.)
                :lHScroll         := (.F.)
                :lVScroll         := (.F.)
                :nMarqueeStyle    := MARQSTYLE_HIGHLROW
                :nColDividerStyle := LINESTYLE_LIGHTGRAY
                :nRowDividerStyle := LINESTYLE_LIGHTGRAY
                :nStretchCol      := STRETCHCOL_WIDEST
                    :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.)   // zero values are not displayed. Added by GNRao. No need to use @Z

                    WITH OBJECT :aCols[01]
                        :cOrder := "A"
                    END
                END
 


I create an empty table, the first time I can add records without problems. the next time I re open the application to add more récords
I get the error below listed
Se crea la tabla vacia, la primera vez puedo agregar el recordset sin problemas, la siguiente vez que abro la aplicación con la
intención de agregar mas registros, me tira el error abajo listado.

But if I define the first field of the table (CUE_CUE) as CHAR instead of DECIMAL there is no error, could you help me?, please.
He detectado que si defino el campo CUE_CUE de tipo CHAR en lugar de DECIMAL, no me tira el error.

This is the error message:
Este es el mensaje del error

    Application
    ===========
    Path and name: C:\AppSap\AppSap.Exe (32 bits)
    Size: 4,378,112 bytes
    Compiler version: Harbour 3.2.0dev (r1801051438)
    FiveWin version: FWH 17.11
    C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
    Windows version: 6.2, Build 9200

    Time from start: 0 hours 0 mins 3 secs
    Error occurred at: 08/07/2018, 17:40: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:ABSOLUTEPOSITION( 0 )
    Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE_SETADO( 5620 )
    Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE( 504 )
    Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:KEYNO( 0 )
    Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE( 605 )
    Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:VUPDATEPOS( 0 )
    Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE( 500 )
    Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:KEYCOUNT( 0 )
    Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:ADJUST( 1433 )
    Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:INITIATE( 1193 )
    Called from: => __OBJSENDMSG( 0 )
    Called from: .\source\function\HARBOUR.PRG => OSEND( 291 )
    Called from: .\source\function\HARBOUR.PRG => ASEND( 259 )
    Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE( 655 )
    Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 331 )
    Called from: Source\AppSap9c.Prg => APPSAP9C( 153 )
    Called from: Source\AppSap.Prg => (b)HAZMENU( 530 )
    Called from: .\source\classes\MENU.PRG => TMENU:COMMAND( 1548 )
    Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND( 1081 )
    Called from: .\source\classes\MDIFRAME.PRG => TMDIFRAME:COMMAND( 262 )
    Called from: => TMDIFRAME:HANDLEEVENT( 0 )
    Called from: .\source\classes\WINDOW.PRG => _FWH( 3348 )
    Called from: => WINRUN( 0 )
    Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1037 )
    Called from: Source\AppSap.Prg => MAIN( 164 )

With Best regards
Saludos
Last edited by Armando on Wed Jul 11, 2018 1:40 am, edited 2 times in total.
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
User avatar
Armando
 
Posts: 3201
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Ayuda con un xBrowse

Postby nageswaragunupudi » Tue Jul 10, 2018 2:21 am

I did not find any problem when I tested this sample:
You may try too.
Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local oCn, oRs, cSql

   oCn   := FW_DemoDB( "ADO" )

   if oCn == nil
      ? "fail"
      return nil
   endif

   ? "connected"

TEXT INTO cSql
 CREATE TABLE IF NOT EXISTS cuentas (
 CUE_CUE DECIMAL(10,0) NOT NULL DEFAULT 0,
 CUE_DES CHAR(35) NOT NULL DEFAULT '',
 PRIMARY KEY(CUE_CUE)
 )
 ENGINE = InnoDB
ENDTEXT

   oCn:Execute( cSql )

   do while MsgYesNo( "Open and edit?" )
      oRs   := FW_OpenRecordSet( oCn, "cuentas" )
      XBROWSER oRs FASTEDIT
      oRs:Close()
   enddo

   oCn:Execute( "DROP TABLE `cuentas`" )

   oCn:Close()

return nil
 
Regards

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

Re: Ayuda con un xBrowse

Postby Armando » Tue Jul 10, 2018 4:11 am

Mr. Rao:

I forgot to mention, I'm using MariaDB

Perhaps there is a problem

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
User avatar
Armando
 
Posts: 3201
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Ayuda con un xBrowse

Postby nageswaragunupudi » Tue Jul 10, 2018 4:23 am

Armando wrote:Mr. Rao:

I forgot to mention, I'm using MariaDB

Perhaps there is a problem

Regards

1) Not at all.

2) Probably your recordset was not open or closed at the time of runtime error.
Please recheck your program carefully.

3) Are you using FW_OpenRecordSet() for opening recordsets?

4) You have built-in MySql/MariaDB library in FWH. I do not know why you do not like use the built-in library.
Regards

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

Re: Ayuda con un xBrowse

Postby Armando » Tue Jul 10, 2018 1:22 pm

1) Not at all.
Ok

2) Probably your recordset was not open or closed at the time of runtime error.
Please recheck your program carefully.
Yes, I will, but If I change the field CUE_CUE as CHAR Instead DECIMAL, There is no error.

3) Are you using FW_OpenRecordSet() for opening recordsets?
No, Just ADO and FWH

4) You have built-in MySql/MariaDB library in FWH. I do not know why you do not like use the built-in library.[/quote]
No, I don't use it

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
User avatar
Armando
 
Posts: 3201
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Ayuda con un xBrowse (SOLUCIONADO)

Postby nageswaragunupudi » Sat Jul 14, 2018 3:20 pm

Mr. Armando,

I tested and confirm that the program I posted above worked perfectly with MariaDB server also.
I could not get back earlier because I was busy with the release of FWH 18.05.

You may try the exact program I posted by changing only the connection.

So, numeric field also works with both MySql and MariaDB servers.
Regards

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

Re: Ayuda con un xBrowse (SOLUCIONADO)

Postby Armando » Sat Jul 14, 2018 3:57 pm

Mr. Rao:

Don't worry. Not problems at all.

I Made a Test:

If I define the CUE_CUE field as the DECIMAL type and as the primary key,
after adding records and exit the program, the next time I open the program,
it sends me the error.

But defining the CUE_CUE field as INTEGER and primary key It works fine.

BTW, do you can help me with another problem?

viewtopic.php?f=6&t=35853

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
User avatar
Armando
 
Posts: 3201
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 62 guests