FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Mr. Rao, Where's the difference?
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Mr. Rao, Where's the difference?
Posted: Fri Feb 26, 2021 02:40 AM
Mr. Rao:

I have these two pieces of code

Code (fw): Select all Collapse
   TRY
      oRsVia  :=  TOleAuto():New("adodb.recordset")
   CATCH oError
      MsgStop( "No se ha podido crear el RECORDSET de Viajes !", oApp:cAplicacion)
      FW_ShowAdoError(oApp:oCon)
      RETURN(.F.)
   END

   oRsVia:CursorLocation   := adUseClient
   oRsVia:LockType         := adLockOptimistic
   oRsVia:CursorType       := adOpenDynamic
   oRsVia:Source           := "SELECT " +;
                                 "*," +;
                                 "TIP_NOM," +;
                                 "TIP_COP," +;
                                 "MAT_DES," +;
                                 "CLI_NOM," +;
                                 "CLI_ALI," +;
                                 "ORI_NOM," +;
                                 "DES_NOM," +;
                                 "OPE_UNI," +;
                                 "OPE_NOM," +;
                                 "UNI_DES," +;
                                 "FOR_DES " +;
                              "FROM " +;
                                 "Viajes " +;
                              "LEFT JOIN " +;
                                 "Tipos " +;
                              "ON " +;
                                 "VIA_TIP = Tipos.TIP_TIP " +;
                              "LEFT JOIN " +;
                                 "Materiales " +;
                              "ON " +;
                                 "VIA_MAT = Materiales.MAT_MAT " +;
                              "LEFT JOIN " +;
                                 "Clientes " +;
                              "ON " +;
                                 "VIA_CLI = Clientes.CLI_CLI " +;
                              "LEFT JOIN " +;
                                 "Origenes " +;
                              "ON " +;
                                 "VIA_ORI = Origenes.ORI_ORI " +;
                              "LEFT JOIN " +;
                                 "Destinos " +;
                              "ON " +;
                                 "VIA_DES = Destinos.DES_DES " +;
                              "LEFT JOIN " +;
                                 "Operadores " +;
                              "ON " +;
                                 "VIA_OPE = Operadores.OPE_OPE " +;
                              "LEFT JOIN " +;
                                 "Unidades " +;
                              "ON " +;
                                 "OPE_UNI = Unidades.UNI_NUM " +;
                              "LEFT JOIN " +;
                                 "Formas " +;
                              "ON " +;
                                 "VIA_FOR = Formas.FOR_FOR " +;
                              "WHERE " +;
                                 "VIA_FDV = '" + DTOS(dHoy) + "' " +;
                              "ORDER BY " +;
                                 "VIA_FOL"

   TRY
      oRsVia:Open(oRsVia:Source,oApp:oCon)
   CATCH oError
      MsgStop( "No se ha podido abrir el RECORDSET de Viajes !", oApp:cAplicacion)
      FW_ShowAdoError(oApp:oCon)
      RETURN(.F.)
   END




Code (fw): Select all Collapse
   oRsVia := FW_OpenRecordSet(oApp:oCon,"SELECT " +;
                                          "*," +;
                                          "TIP_NOM," +;
                                          "TIP_COP," +;
                                          "MAT_DES," +;
                                          "CLI_NOM," +;
                                          "CLI_ALI," +;
                                          "ORI_NOM," +;
                                          "DES_NOM," +;
                                          "OPE_UNI," +;
                                          "OPE_NOM," +;
                                          "UNI_DES," +;
                                          "FOR_DES " +;
                                       "FROM " +;
                                          "Viajes " +;
                                       "LEFT JOIN " +;
                                          "Tipos " +;
                                       "ON " +;
                                          "VIA_TIP = Tipos.TIP_TIP " +;
                                       "LEFT JOIN " +;
                                          "Materiales " +;
                                       "ON " +;
                                          "VIA_MAT = Materiales.MAT_MAT " +;
                                       "LEFT JOIN " +;
                                          "Clientes " +;
                                       "ON " +;
                                          "VIA_CLI = Clientes.CLI_CLI " +;
                                       "LEFT JOIN " +;
                                          "Origenes " +;
                                       "ON " +;
                                          "VIA_ORI = Origenes.ORI_ORI " +;
                                       "LEFT JOIN " +;
                                          "Destinos " +;
                                       "ON " +;
                                          "VIA_DES = Destinos.DES_DES " +;
                                       "LEFT JOIN " +;
                                          "Operadores " +;
                                       "ON " +;
                                          "VIA_OPE = Operadores.OPE_OPE " +;
                                       "LEFT JOIN " +;
                                          "Unidades " +;
                                       "ON " +;
                                          "OPE_UNI = Unidades.UNI_NUM " +;
                                       "LEFT JOIN " +;
                                          "Formas " +;
                                       "ON " +;
                                          "VIA_FOR = Formas.FOR_FOR " +;
                                       "WHERE " +;
                                          "VIA_FDV = '" + DTOS(dHoy) + "' " +;
                                       "ORDER BY " +;
                                          "VIA_FOL",adLockOptimistic,adOpenDynamic,0)

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





They both do the same thing, create and open a record set and show it on a xbrowse
The first one works very well and shows the xbrowse but the second one does not show
the xbrowse, it does not send error, it just does not show the xbrowse

Do you have any clue?

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: Mr. Rao, Where's the difference?
Posted: Sat Feb 27, 2021 11:25 AM
Can you execute this and let me know the result?
Code (fw): Select all Collapse
? oApp:oCon:CursorLocation
Regards



G. N. Rao.

Hyderabad, India
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Mr. Rao, Where's the difference?
Posted: Sat Feb 27, 2021 04:54 PM

Mr. Rao:

It shows the number 2

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: Mr. Rao, Where's the difference?
Posted: Sun Feb 28, 2021 04:15 AM
Can you please set
Code (fw): Select all Collapse
oApp:oCn:CursorLocation := 3

and then try FW_OpenRecordSet(...)
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion