I have these two pieces of code
- Code: Select all Expand view
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: Select all Expand view
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