FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Problema con xBrowse (RESUELTO)
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Problema con xBrowse (RESUELTO)
Posted: Mon Apr 18, 2022 05:04 PM
Mr. Rao y amigos del foro

Tengo el siguiente c贸digo:

Code (fw): Select all Collapse
聽 聽oRsDsl 聽 := FW_OpenRecordSet(oApp:oCon,"SELECT " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"*," + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"OPE_NOM," +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"UNI_DES " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "FROM " + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"Diesel " + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "LEFT JOIN " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"Operadores " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "ON " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"DIE_OPE = Operadores.OPE_OPE " +; 聽 聽 聽 聽 聽 聽<=======
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "LEFT JOIN " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"Unidades " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "ON " +;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"DIE_UNI = Unidades.UNI_NUM " +; 聽 聽 聽 聽 聽 聽 聽 聽<=======
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "WHERE " + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"DIE_FDM = '" + Dtos( dHoy ) + "' " + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "ORDER BY " + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽"DIE_FOL",adLockOptimistic,adOpenDynamic,0)


Con el c贸digo anterior creo una tabla con dos LEFT JOIN y muestro el recordset en un xBrowse

Lo relevante son los LEFT JOIN de la tabla principal (Diesel) a dos tablas m谩s (Operadores y Unidades),
en la tabla DIESEL se mantiene el registro de las compras y consumos de diesel, cuando se trata de un
consumo se especifica en que unidad (CAMION) y Operador se realiz贸 el consumo, pero cuando se trata
de una COMPRA no hay ni UNIDAD ni OPERADOR, porque va a un deposito, por lo tanto no se da la
relaci贸n con las respectivas tablas y el xBrowse me tira un error

Intente definiendo los campos UNIDAD y OPERADOR como NULL pero a煤n as铆 me tira error.

Alguna idea o soluci贸n?

Saludos
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: Problema con xBrowse
Posted: Mon Apr 18, 2022 06:51 PM

Is it OpenRecordset Error or XBrowse error?
Please show here the error.

By the way, do not use "Dtos( dHoy )". Use FW_ValToSql( dHoy ).

Regards



G. N. Rao.

Hyderabad, India
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Problema con xBrowse
Posted: Mon Apr 18, 2022 09:59 PM
Mr. Rao:

This is the error code:

Code (fw): Select all Collapse
Application
===========
   Path and name: C:\SiaJAEM\SiaJAEM.Exe (32 bits)
   Size: 5,468,160 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 11 secs 
   Error occurred at: 18/04/2022, 16:53:54
   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\SiaJAEM6a.Prg => SIAJAEM6A( 329 )
   Called from: Source\SiaJAEM.Prg => (b)HAZMENU( 649 )
   Called from: .\source\classes\MENU.PRG => TMENU:COMMAND( 1560 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND( 1141 )
   Called from: .\source\classes\MDIFRAME.PRG => TMDIFRAME:COMMAND( 272 )
   Called from:  => TMDIFRAME:HANDLEEVENT( 0 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3559 )
   Called from:  => WINRUN( 0 )
   Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1097 )
   Called from: Source\SiaJAEM.Prg => MAIN( 180 )


I think is a recordset error because the related fields are cero value

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: Problema con xBrowse
Posted: Tue Apr 19, 2022 02:52 AM

First test if the RecordSet is created correctly.
After FW_OpenRecordSet(...), please check ? oRs:RecordCount()

Regards



G. N. Rao.

Hyderabad, India
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Problema con xBrowse
Posted: Tue Apr 19, 2022 02:49 PM

Mr. Rao:

Thanks for your advise, using NULL fields my problem is solved.

Thanks again, 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

Continue the discussion