gautxori:
Asumo que estas usando Tablas de MySql, como sabemos en MySql todos los datos
los maneja como alfanuméricos, por lo tanto prueba con
AP_FECHA := DTOS("31/12/1994")
Ojalá te ayude.
Saludos
static FUNCTION Grabar()
If cOpcion="A"
APPEND BLANK
cOpcion="C"
EndIf
Obr->ob_codi :=cob_codi
Obr->ob_nomb :=cob_nomb
Obr->ob_dire :=cob_dire
Obr->ob_pobl :=cob_pobl
Obr->ob_prov :=cob_prov
Obr->ob_cpos :=cob_cpos
Obr->ob_fecini:=cob_fecini
Obr->ob_fecfin:=cob_fecfin
Obr->ob_codcli:=cob_codcli
Obr->ob_saldo :=nob_saldo
If cOpcion="M"
UnLock
EndIf
Return NIL
static FUNCTION Grabar()
local dfecha
dfecha:= dtos(cob_fecini)
MSGINFO (dfecha)
If cOpcion="A"
APPEND BLANK
cOpcion="C"
EndIf
Obr->ob_codi :=cob_codi
Obr->ob_nomb :=cob_nomb
Obr->ob_dire :=cob_dire
Obr->ob_pobl :=cob_pobl
Obr->ob_prov :=cob_prov
Obr->ob_cpos :=cob_cpos
Obr->ob_fecini:= (dfecha)
Obr->ob_fecfin:=cob_fecfin
Obr->ob_codcli:=cob_codcli
Obr->ob_saldo :=nob_saldo
If cOpcion="M"
UnLock
EndIf
Return NIL
Antonio Linares wrote:Angel,
En la línea 1882 de ADORDD.prg tenemos:
IF !aWAData[ WA_EOF ] .AND. !( oRecordSet:Fields( nField - 1 ):Value == xvalue )
Lo que quiere decir es que ese campo en el recordSet es de tipo fecha y el valor que quieres asignarle es de tipo caracter
Error description: Error BASE/1070 Argument error: ==
Args:
[ 1] = D 0d19890215
[ 2] = C 20160215
Antonio Linares wrote:En la línea .\SOURCE\AbmObr.PRG => GRABAR( 147 ) pasa la fecha de caracter a tipo fecha usando CToD()
cob_fecini:=space (10)
cob_fecfin:=space (10)
Static Function Datos()
DEFINE DIALOG oDDAbmObr OF oWndObr RESOURCE "ABM_OBR_DATOS"
REDEFINE GET oob_nomb VAR cob_nomb ID 802 OF oDDAbmObr
REDEFINE GET oob_dire VAR cob_dire ID 803 OF oDDAbmObr
REDEFINE GET oob_pobl VAR cob_pobl ID 804 OF oDDAbmObr
REDEFINE GET oob_prov VAR cob_prov ID 805 OF oDDAbmObr
REDEFINE GET oob_cpos VAR cob_cpos ID 806 OF oDDAbmObr
REDEFINE GET oob_fecini VAR cob_fecini ID 807 OF oDDAbmObr
REDEFINE GET oob_fecfin VAR cob_fecfin ID 808 OF oDDAbmObr
REDEFINE BUTTON oBtnCue ID 811 OF oDDAbmObr ACTION If(HelpCue(),VolHelp_Cue(.t.),VolHelp_Cue(.f.))
REDEFINE GET oob_Codcli VAR cob_codcli ID 809 OF oDDAbmObr Valid Cuenta()
REDEFINE SAY oNombre PROMPT cNombre ID 810 OF oDdAbmObr
REDEFINE SAY oob_saldo PROMPT nob_saldo ID 812 PICTURE "999,999,999,999" OF oDdAbmObr
REDEFINE BUTTON oBtnSi ID 819 OF oDDAbmObr ACTION Aceptar()
REDEFINE BUTTON oBtnNo ID 820 OF oDDAbmObr ACTION Cancelar()
Cerrar_SiNo()
ACTIVATE DIALOG oDDAbmObr NOWAIT;
static FUNCTION VerCampos()
cob_codi:=Obr->ob_codi;oob_codi:Refresh()
cob_nomb:=Obr->ob_nomb;oob_nomb:Refresh()
cob_dire:=Obr->ob_dire;oob_dire:Refresh()
cob_pobl:=Obr->ob_pobl;oob_pobl:Refresh()
cob_prov:=Obr->ob_prov;oob_prov:Refresh()
cob_cpos:=Obr->ob_cpos;oob_cpos:Refresh()
cob_fecini:=Obr->ob_fecini ;oob_fecini :Refresh()
cob_fecfin:=Obr->ob_fecfin;oob_fecfin:Refresh()
nob_saldo :=Obr->ob_saldo ;oob_saldo :Refresh()
cob_codcli:=Obr->ob_codcli
DbSelectArea("Cue")
cob_codcli:=rllceros(cob_codcli,6);oob_codcli:Refresh()
SEEK cob_codcli
cNombre:=Cue->Cu_Nomb
oNombre:refresh()
DbSelectArea("obr")
return nil
static FUNCTION Grabar()
local dfecha
dfecha:= ctod(cob_fecini) ----------------------------------------- DA ERROR AQUI
MSGINFO (dfecha)
If cOpcion="A"
APPEND BLANK
cOpcion="C"
EndIf
Obr->ob_codi :=cob_codi
Obr->ob_nomb :=cob_nomb
Obr->ob_dire :=cob_dire
Obr->ob_pobl :=cob_pobl
Obr->ob_prov :=cob_prov
Obr->ob_cpos :=cob_cpos
Obr->ob_fecini:= dfecha
Obr->ob_fecfin:=cob_fecfin
Obr->ob_codcli:=cob_codcli
Obr->ob_saldo :=nob_saldo
If cOpcion="M"
UnLock
EndIf
Return NIL
cob_fecini:=ctod(space(8))
cob_fecfin:=ctod(space(8))
Antonio Linares wrote:Comprueba si usas:
SET DATE TO ...
SET CENTURY ...
SET DATE FORMAT TO ...
SET EPOCH TO ...
dfecha:= ctod("01/01/2016")
MSGINFO (dfecha)
Obr->ob_fecini:= ctod("01/01/2016")
Obr->ob_fecfin:=cob_fecfin
Application
===========
Path and name: D:\OBRAS32\Obras32.exe (32 bits)
Size: 3,718,656 bytes
Compiler version: Harbour 3.2.0dev (r1601050904)
FiveWin Version: FWH 16.03
Windows version: 6.2, Build 9200
Time from start: 0 hours 0 mins 16 secs
Error occurred at: 2016-05-10, 17:05:26
Error description: (DOS Error -2147352567) WINOLE/1007 [MySQL][ODBC 5.3(a) Driver][mysqld-5.7.12-log]Incorrect date value: '0d20160101' for column 'OB_FECINI' at row 1 (0x80004005): Microsoft OLE DB Provider for ODBC Drivers
Args:
[ 1] = C UPDATE OBRAS SET `OB_FECINI` = '0d20160101' WHERE `ID` = 2
[ 2] = U NIL
[ 3] = N 128
Stack Calls
===========
Called from: => TOLEAUTO:EXECUTE( 0 )
Called from: .\SOURCE\adordd.PRG => ADO_PUTVALUE( 1944 )
Called from: .\SOURCE\AbmObr.PRG => GRABAR( 149 )
Called from: .\SOURCE\AbmObr.PRG => ACEPTAR( 280 )
Called from: .\SOURCE\AbmObr.PRG => (b)DATOS( 120 )
Called from: .\source\classes\BUTTON.PRG => TBUTTON:CLICK( 179 )
Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT( 1687 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3278 )
Called from: => SENDMESSAGE( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND( 413 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 905 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3278 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1041 )
Called from: .\SOURCE\Obras32.PRG => MAIN( 194 )
System
======
CPU type: Intel(R) Pentium(R) CPU N3700 @ 1.60GHz 1600 Mhz
Hardware memory: 3946 megs
Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %
Windows total applications running: 7
1 ,
2 , C:\WINDOWS\SYSTEM32\SHELL32.dll
3 , C:\WINDOWS\SYSTEM32\shcore.dll
4 , C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.10586.0_none_d3c2e4e96
5 , D:\OBRAS32\OBRAS32.DLL
6 , D:\OBRAS32\Obras32.exe
7 GDI+ Window, C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.10586.20_none_22adb5eaa762c7fa
Variables in use
================
Procedure Type Value
==========================
TOLEAUTO:EXECUTE
Param 1: O Class: ERROR
ADO_PUTVALUE
Param 1: C "UPDATE OBRAS SET `OB_FECINI` = '0d20160101' WHERE `ID` = 2"
Param 2: U NIL
Param 3: N 128
Local 1: U NIL
Local 2: U ???:U
GRABAR
Param 1: N 4
Param 2: N 8
Param 3: D 0d20160101
Local 1: A Len: 42
Local 2: O Class: TOLEAUTO
Local 3: N 2
Local 4: U NIL
Local 5: C "dd-mm-yyyy"
Local 6: A Len: 7
Local 7: U NIL
Local 8: A Len: 0
Local 9: U NIL
Local 10: U NIL
Local 11: U NIL
ACEPTAR
Local 1: D 0d20160101
Local 2: D 0d20160101
Local 3: U NIL
(b)DATOS
TBUTTON:CLICK
Param 1: O Class: TBUTTON
TBUTTON:HANDLEEVENT
_FWH
Param 1: N 2048
Param 2: N 0
Param 3: N 0
Local 1: U NIL
SENDMESSAGE
Param 1: N 0
Param 2: N 2048
Param 3: N 0
Param 4: N 0
Param 5: N 42
Local 1: O Class: TBUTTON
TDIALOG:COMMAND
Param 1: N 1508462
Param 2: N 2048
Param 3: N 0
Param 4: N 0
TWINDOW:HANDLEEVENT
Param 1: N 819
Param 2: N 1508462
Local 1: O Class: TBUTTON
Local 2: N 0
Local 3: N 819
Local 4: N 1508462
Local 5: U NIL
TDIALOG:HANDLEEVENT
Param 1: N 273
Param 2: N 819
Param 3: N 1508462
_FWH
Param 1: N 273
Param 2: N 819
Param 3: N 1508462
WINRUN
Param 1: N 1508462
Param 2: N 273
Param 3: N 819
Param 4: N 1508462
Param 5: N 30
Local 1: O Class: TDIALOG
TMDIFRAME:ACTIVATE
Param 1: N 1574310
MAIN
Param 1: C "NORMAL"
Param 2: U NIL
Param 3: U NIL
Param 4: U NIL
Param 5: U NIL
Param 6: U NIL
Param 7: U NIL
Param 8: B {|| ... }
Param 9: U NIL
Param 10: U NIL
Param 11: U NIL
Param 12: U NIL
Param 13: U NIL
Param 14: U NIL
Param 15: U NIL
Param 16: U NIL
Param 17: B {|| ... }
Param 18: U NIL
Param 19: U NIL
Param 20: L .F.
Local 1: O Class: TMDIFRAME
Local 2: U NIL
Local 3: U NIL
Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFNTX
ADORDD
DataBases in use
================
1: CONCEP RddName: ADORDD
==============================
RecNo RecCount BOF EOF
1 57 .F. .F.
Indexes in use TagName
=> CP_CODI CONIND01
Relations in use
2: EMPRE RddName: ADORDD
==============================
RecNo RecCount BOF EOF
1 28 .F. .F.
Indexes in use TagName
Relations in use
3: CUE RddName: ADORDD
==============================
RecNo RecCount BOF EOF
2 458 .F. .F.
Indexes in use TagName
=> CU_CODI CUEIND01
Relations in use
4: => OBR RddName: ADORDD
==============================
RecNo RecCount BOF EOF
2 398 .F. .F.
Indexes in use TagName
=> OB_CODI OBRIND01
Relations in use
Classes in use:
===============
1 ERROR
2 HBCLASS
3 HBOBJECT
4 TINI
5 TWINDOW
6 TCONTROL
7 TICON
8 TBRUSH
9 WIN_OLEAUTO
10 TOLEAUTO
11 TMDIFRAME
12 TMENU
13 TMENUITEM
14 TMDICLIENT
15 TFONT
16 TIMAGELIST
17 TBITMAP
18 TTOOLBAR
19 TMSGBAR
20 TRECT
21 TMSGITEM
22 TTIMER
23 TDIALOG
24 TBTNBMP
25 TXBROWSE
26 TBUTTON
27 TSCROLLBAR
28 TXBRWCOLUMN
29 TSAY
30 TGET
31 GET
32 TCLIPGET
33 TMULTIGET
34 TREG32
Memory Analysis
===============
1809 Static variables
Dynamic memory consume:
Actual Value: 0 bytes
Highest Value: 0 bytes
Kleyber wrote:gautxori,
Intenta asi:
- Code: Select all Expand view
cob_fecini:=ctod(space(8))
cob_fecfin:=ctod(space(8))
Y me comentas.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 33 guests