Hola,
En AdoDatasource:Query (y familia) no se está haciendo bien el tema de
las propiedades después de haber creado el recordset. Las propiedades
nCursorLocation, nCursorType y nLockType solo son asignables _antes_ de
crear el recordset. Este código
METHOD Query( cCommand, cProcess ) CLASS XAdoDataSource
LOCAL oDataSet
DEFAULT cProcess TO ::cProcess
IF ! ::CheckConnection()
RETURN .F.
ENDIF
WITH OBJECT oDataSet := TSQLQuery():Create( ::oParent, Self,
cCommand, Upper( cProcess ) )
:nCursorLocation := adUseClient
:nCursorType := adOpenStatic
:nLockType := adLockOptimistic
END WITH
RETURN oDataSet
Yo lo cambiaría por este otro:
METHOD Query( cCommand, cProcess, nLockType, nCursorLocation,
nCursorType ) CLASS XAdoDataSource
LOCAL oDataSet
DEFAULT cProcess TO ::cProcess
DEFAULT nLockType TO adLockOptimistic
DEFAULT nCursorLocation TO adUseClient
DEFAULT nCursorType TO adOpenStatic
IF ! ::CheckConnection()
RETURN .F.
ENDIF
WITH OBJECT oDataSet := TSQLQuery():New( )
:nCursorLocation := nCursorLocation
:nCursorType := nCursorType
:nLockType := nLockType
:Create( ::oParent, Self, cCommand, Upper( cProcess ) )
END WITH
RETURN oDataSet
Por cierto... habría que revisar todos los métodos QueryXXX para que se
devuelva siempre un objeto tDataset (tal como indica la ayuda).
Creo que
IF ! ::CheckConnection()
RETURN .F.
ENDIF
Debería ser
IF ! ::CheckConnection()
RETURN tDataset():New()
ENDIF
O similar... Más que nada para mantener coherencia con lo que se devuelve.
Saludos,
José Luis Capel
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
AdoDatasource: varias cosas
- ignacio
- Site Admin
- Mensajes: 9459
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
AdoDatasource: varias cosas
José Luis,
> Yo lo cambiaría por este otro:
Entiendo que la funcionalidad de ambos códigos es muy parecida ya que
TSQLQuery():Create() realmente no abre el dataset.
> Por cierto... habría que revisar todos los métodos QueryXXX para que se
> devuelva siempre un objeto tDataset (tal como indica la ayuda).
A cuales te refieres exactamente.
Gracias
Saludos
--
Ignacio Ortiz de Zúñiga
Xailer support / Soporte de Xailer
http://www.xailer.com
http://www.xailer.info
"José Luis Capel ~ AgSoft" <jose.luis@iaicom.com> escribió en el mensaje
news:4b0ea1b0$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
> Hola,
>
> En AdoDatasource:Query (y familia) no se está haciendo bien el tema de las
> propiedades después de haber creado el recordset. Las propiedades
> nCursorLocation, nCursorType y nLockType solo son asignables _antes_ de
> crear el recordset. Este código
>
>
> METHOD Query( cCommand, cProcess ) CLASS XAdoDataSource
>
> LOCAL oDataSet
>
> DEFAULT cProcess TO ::cProcess
>
> IF ! ::CheckConnection()
> RETURN .F.
> ENDIF
>
> WITH OBJECT oDataSet := TSQLQuery():Create( ::oParent, Self, cCommand,
> Upper( cProcess ) )
> :nCursorLocation := adUseClient
> :nCursorType := adOpenStatic
> :nLockType := adLockOptimistic
> END WITH
>
> RETURN oDataSet
>
> Yo lo cambiaría por este otro:
>
>
> METHOD Query( cCommand, cProcess, nLockType, nCursorLocation,
> CursorType ) CLASS XAdoDataSource
>
> LOCAL oDataSet
>
> DEFAULT cProcess TO ::cProcess
> DEFAULT nLockType TO adLockOptimistic
> DEFAULT nCursorLocation TO adUseClient
> DEFAULT nCursorType TO adOpenStatic
>
> IF ! ::CheckConnection()
> RETURN .F.
> ENDIF
>
> WITH OBJECT oDataSet := TSQLQuery():New( )
> :nCursorLocation := nCursorLocation
> :nCursorType := nCursorType
> :nLockType := nLockType
> :Create( ::oParent, Self, cCommand, Upper( cProcess ) )
> END WITH
>
>
> RETURN oDataSet
>
>
> Por cierto... habría que revisar todos los métodos QueryXXX para que se
> devuelva siempre un objeto tDataset (tal como indica la ayuda).
>
> Creo que
>
> IF ! ::CheckConnection()
> RETURN .F.
> ENDIF
>
> Debería ser
>
> IF ! ::CheckConnection()
> RETURN tDataset():New()
> ENDIF
>
> O similar... Más que nada para mantener coherencia con lo que se devuelve.
>
> Saludos,
> José Luis Capel
>
> Yo lo cambiaría por este otro:
Entiendo que la funcionalidad de ambos códigos es muy parecida ya que
TSQLQuery():Create() realmente no abre el dataset.
> Por cierto... habría que revisar todos los métodos QueryXXX para que se
> devuelva siempre un objeto tDataset (tal como indica la ayuda).
A cuales te refieres exactamente.
Gracias
Saludos
--
Ignacio Ortiz de Zúñiga
Xailer support / Soporte de Xailer
http://www.xailer.com
http://www.xailer.info
"José Luis Capel ~ AgSoft" <jose.luis@iaicom.com> escribió en el mensaje
news:4b0ea1b0$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
> Hola,
>
> En AdoDatasource:Query (y familia) no se está haciendo bien el tema de las
> propiedades después de haber creado el recordset. Las propiedades
> nCursorLocation, nCursorType y nLockType solo son asignables _antes_ de
> crear el recordset. Este código
>
>
> METHOD Query( cCommand, cProcess ) CLASS XAdoDataSource
>
> LOCAL oDataSet
>
> DEFAULT cProcess TO ::cProcess
>
> IF ! ::CheckConnection()
> RETURN .F.
> ENDIF
>
> WITH OBJECT oDataSet := TSQLQuery():Create( ::oParent, Self, cCommand,
> Upper( cProcess ) )
> :nCursorLocation := adUseClient
> :nCursorType := adOpenStatic
> :nLockType := adLockOptimistic
> END WITH
>
> RETURN oDataSet
>
> Yo lo cambiaría por este otro:
>
>
> METHOD Query( cCommand, cProcess, nLockType, nCursorLocation,
> CursorType ) CLASS XAdoDataSource
>
> LOCAL oDataSet
>
> DEFAULT cProcess TO ::cProcess
> DEFAULT nLockType TO adLockOptimistic
> DEFAULT nCursorLocation TO adUseClient
> DEFAULT nCursorType TO adOpenStatic
>
> IF ! ::CheckConnection()
> RETURN .F.
> ENDIF
>
> WITH OBJECT oDataSet := TSQLQuery():New( )
> :nCursorLocation := nCursorLocation
> :nCursorType := nCursorType
> :nLockType := nLockType
> :Create( ::oParent, Self, cCommand, Upper( cProcess ) )
> END WITH
>
>
> RETURN oDataSet
>
>
> Por cierto... habría que revisar todos los métodos QueryXXX para que se
> devuelva siempre un objeto tDataset (tal como indica la ayuda).
>
> Creo que
>
> IF ! ::CheckConnection()
> RETURN .F.
> ENDIF
>
> Debería ser
>
> IF ! ::CheckConnection()
> RETURN tDataset():New()
> ENDIF
>
> O similar... Más que nada para mantener coherencia con lo que se devuelve.
>
> Saludos,
> José Luis Capel
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com