Página 1 de 1

Problema con AddCalcField() y oDBMemo

Publicado: Sab Ene 09, 2010 10:11 pm
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 ?

Problema con AddCalcField() y oDBMemo

Publicado: Lun Ene 11, 2010 12:57 pm
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 ?
>
>