Problema con xBrowse (RESUELTO)

Problema con xBrowse (RESUELTO)

Postby Armando » Mon Apr 18, 2022 5:04 pm

Mr. Rao y amigos del foro

Tengo el siguiente código:

Code: Select all  Expand view

   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
Last edited by Armando on Tue Apr 19, 2022 2:50 pm, edited 1 time 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: 3061
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Problema con xBrowse

Postby nageswaragunupudi » Mon Apr 18, 2022 6: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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Problema con xBrowse

Postby Armando » Mon Apr 18, 2022 9:59 pm

Mr. Rao:

This is the error code:

Code: Select all  Expand view

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

Re: Problema con xBrowse

Postby nageswaragunupudi » Tue Apr 19, 2022 2:52 am

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

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

Re: Problema con xBrowse

Postby Armando » Tue Apr 19, 2022 2: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
User avatar
Armando
 
Posts: 3061
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: Google [Bot] and 82 guests