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.

Problema con AddCalcField() y oDBMemo

Foro de Xailer profesional en español
Responder
Jesus Semper
Mensajes: 54
Registrado: Lun Ene 04, 2010 2:40 pm

Problema con AddCalcField() y oDBMemo

Mensaje por Jesus Semper »

Tengo un problema al que no le encuentro solucion y no se que estoy haciendo
mal.
He definido dentro de un FormInitialize los siguientes campos calculados:
::oDbfDataSet1:AddCalcField( "cDes_Art", {|oField|
OemToAnsi(oField:oDataSet:DES_ART) } )
::oDbfDataSet1:AddCalcField( "nLinea", {|oField|
Str(Asc(oField:oDataSet:NL),3) } )
::oDbfDataSet1:AddCalcField( "nPreTot", {|oField| oField:oDataSet:CAN_LPE
* oField:oDataSet:PRE_ART} )
::oDbfDataSet1:AddCalcField( "cDes_Esp", {|oField|
OemToAnsi(oField:oDataSet:DES_ESP) } ) // ME DA PROBLEMAS
Todos ellos existen y, salvo el ultimo, DES_ESP que es un Memo e intento
asignarlo a un oDBMemo, funcionan perfectamente cuando los asigno a
oDBBrowse1.
En el caso del oDBMemo1, asigno su oDataField a "cDes_Esp" y ahi es donde me
salta el siguiente error:
TDBFDATASET:DES_ESP(2097)
Error BASE/1004 Message not found: TDbfDataSet:DES_ESP
Argumentos: ( [ 1] = Tipo: N Valor: 0)
***************************** Registro de errores
*****************************
Exe: c:MsemWConfirmar.exe
Version: 1.0.0.0
User name: JSO
Computer name: JSO-1
Fecha: 09/01/10
Hora: 22:03:08
Memoria libre: 908324
Area actual: 2
------------------------- Información del
compilador --------------------------
Versión Xailer: Xailer 2.0.4 Version 2.0.4
Compilador: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 6511) PCode
Version: 10
Compilador C/C++: Borland C++ 5.5.1 (32 bit)
Plataforma: Windows XP Professional 5.01.2600 Service Pack 2
----------------------- Información detallada del
error -----------------------
Subsistema: BASE
Código de error: 1004
Estado: .F.
Descripción: Message not found
Operación: TDbfDataSet:DES_ESP
Argumentos: [ 1] = Tipo: N Valor: 0
Fichero:
Código error SO: 0
Pila de llamadas:
TDBFDATASET:DES_ESP (2105)
(b)TFORM2:FORMINITIALIZE (67)
TDATAFIELD:ONGETVALUE (0)
TDATAFIELD:VALUE (93)
TDBMEMO:DCSETFIELDOBJECT (69)
TDBMEMO:_ODATAFIELD (62)
TDBFDATASET:ADDCALCFIELD (1091)
TFORM2:FORMINITIALIZE (67)
TFORM2:ONINITIALIZE (0)
TFORM2:NEW (187)
TFORM1:BUTTON2CLICK (859)
TBUTTON:ONCLICK (0)
TBUTTON:CLICK (100)
TBUTTON:SHORTCUT (116)
TFORM1:WMSYSCHAR (646)
(b)XCONTROL:XCONTROL (170)
TEDIT:WMSYSCHAR (0)
RUNFORM (0)
TAPPLICATION:RUN (272)
MAIN (15)
...................
Para intentar saber lo que pasaba he asignado a oDBMemo1:oDataField el campo
de la DBF: "Des_Esp" y posteriormente dentro del evento DBBrowse1Change()
pongo un mensaje:
//-- Control
MsgBox(MemoTran(::oDbfDataSet1:cDes_Esp))
¡¡ Y FUNCIONA SIN PROBLEMAS !! NO me da error y reconoce el campo calculado.
¿Que estoy haciendo mal al asignar el campo calculado al oDBMemo1 ?
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9441
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Problema con AddCalcField() y oDBMemo

Mensaje por ignacio »

Jesus,
Por el error reportado da la sensación que el campo 'des_esp' no existe en
dicha tabla.
Un saludo,
--
Ignacio Ortiz de Zúñiga
[Equipo de Xailer/Xailer team]
http://www.xailer.com
http://www.xailer.info
"Jesus Semper" <jesus@semper-sl.com> escribió en el mensaje de
noticias:4b48f0f6$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
> Tengo un problema al que no le encuentro solucion y no se que estoy
> haciendo mal.
>
> He definido dentro de un FormInitialize los siguientes campos calculados:
>
> ::oDbfDataSet1:AddCalcField( "cDes_Art", {|oField|
> OemToAnsi(oField:oDataSet:DES_ART) } )
> ::oDbfDataSet1:AddCalcField( "nLinea", {|oField|
> Str(Asc(oField:oDataSet:NL),3) } )
> ::oDbfDataSet1:AddCalcField( "nPreTot", {|oField|
> oField:oDataSet:CAN_LPE * oField:oDataSet:PRE_ART} )
>
> ::oDbfDataSet1:AddCalcField( "cDes_Esp", {|oField|
> OemToAnsi(oField:oDataSet:DES_ESP) } ) // ME DA PROBLEMAS
>
> Todos ellos existen y, salvo el ultimo, DES_ESP que es un Memo e intento
> asignarlo a un oDBMemo, funcionan perfectamente cuando los asigno a
> oDBBrowse1.
>
> En el caso del oDBMemo1, asigno su oDataField a "cDes_Esp" y ahi es donde
> me salta el siguiente error:
>
> TDBFDATASET:DES_ESP(2097)
> Error BASE/1004 Message not found: TDbfDataSet:DES_ESP
> Argumentos: ( [ 1] = Tipo: N Valor: 0)
> ***************************** Registro de errores
> *****************************
>
> Exe: c:MsemWConfirmar.exe
> Version: 1.0.0.0
> User name: JSO
> Computer name: JSO-1
> Fecha: 09/01/10
> Hora: 22:03:08
> Memoria libre: 908324
> Area actual: 2
>
> ------------------------- Información del
> compilador --------------------------
>
> Versión Xailer: Xailer 2.0.4 Version 2.0.4
> Compilador: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 6511) PCode
> Version: 10
> Compilador C/C++: Borland C++ 5.5.1 (32 bit)
> Plataforma: Windows XP Professional 5.01.2600 Service Pack 2
>
> ----------------------- Información detallada del
> error -----------------------
>
> Subsistema: BASE
> Código de error: 1004
> Estado: .F.
> Descripción: Message not found
> Operación: TDbfDataSet:DES_ESP
> Argumentos: [ 1] = Tipo: N Valor: 0
> Fichero:
> Código error SO: 0
>
> Pila de llamadas:
> TDBFDATASET:DES_ESP (2105)
> (b)TFORM2:FORMINITIALIZE (67)
> TDATAFIELD:ONGETVALUE (0)
> TDATAFIELD:VALUE (93)
> TDBMEMO:DCSETFIELDOBJECT (69)
> TDBMEMO:_ODATAFIELD (62)
> TDBFDATASET:ADDCALCFIELD (1091)
> TFORM2:FORMINITIALIZE (67)
> TFORM2:ONINITIALIZE (0)
> TFORM2:NEW (187)
> TFORM1:BUTTON2CLICK (859)
> TBUTTON:ONCLICK (0)
> TBUTTON:CLICK (100)
> TBUTTON:SHORTCUT (116)
> TFORM1:WMSYSCHAR (646)
> (b)XCONTROL:XCONTROL (170)
> TEDIT:WMSYSCHAR (0)
> RUNFORM (0)
> TAPPLICATION:RUN (272)
> MAIN (15)
> ..................
>
> Para intentar saber lo que pasaba he asignado a oDBMemo1:oDataField el
> campo de la DBF: "Des_Esp" y posteriormente dentro del evento
> DBBrowse1Change() pongo un mensaje:
>
> //-- Control
> MsgBox(MemoTran(::oDbfDataSet1:cDes_Esp))
>
>
> ¡¡ Y FUNCIONA SIN PROBLEMAS !! NO me da error y reconoce el campo
> calculado.
>
> ¿Que estoy haciendo mal al asignar el campo calculado al oDBMemo1 ?
>
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Responder