cValToStr() error *Fixed*

cValToStr() error *Fixed*

Postby dutch » Wed Jun 18, 2014 2:17 am

It has occur an error while TXBrwose need to convert TIMESTAMP field in MySql. I try TDolphin but some field is TIMESTAMP and got an error.
Code: Select all  Expand view
  Path and name: D:\FWH1305\download\TDolphin\download\testpag.exe (32 bits)
   Size: 2,680,320 bytes
   Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20130903)
   FiveWin  Version: FWHX 13.11
   Windows version: 6.1, Build 7601 Service Pack 1

   Time from start: 0 hours 0 mins 1 secs
   Error occurred at: 06/18/14, 09:10:07
   Error description: Error BASE/1118  Argument error: TTOC
   Args:
     [   1] = C   ...

Stack Calls
===========
   Called from:  => TTOC( 0 )
   Called from: .\source\function\VALTOSTR.PRG => CVALTOSTR( 95 )

Thank you for any help and idea.
Last edited by dutch on Thu Jun 19, 2014 7:08 am, edited 1 time in total.
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: cValToStr() error

Postby nageswaragunupudi » Thu Jun 19, 2014 12:37 am

Mr Dutch

Please help me with the results of :
? oQry:FieldType( <ntimestampfield> )
? ValType( oQry:FieldGet( <timestamefield> ) )

If both results are 'T' then please make this modification:
Locate method SetColFromMySQL(...) in xbrowse.prg.
Please change the line
Code: Select all  Expand view
  CASE cType       == 'D'

as
Code: Select all  Expand view
  CASE cType       $ 'DT'


If in the above test,
? ValType( oQry:FieldGet( <timestamefield> ) )
returns 'C' instead of 'T', please insert these two lines just before "OTHERWISE"
Code: Select all  Expand view
CASE cType == 'T'
                  cType := 'C'
 

I shall be glad if you can respond early.

PS: Regret I am not able to test myself as my development PC is under maintenance.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: cValToStr() error

Postby dutch » Thu Jun 19, 2014 6:51 am

Dear Mr.Rao,

I've test the result ValType() of TimeStamp field as below
Code: Select all  Expand view
   cValType := valtype( oQry:FieldGet( 'rta_stamp' )) return "C"
   cValType := oQry:FieldType( 'rta_stamp' )    return "T"
   cValType := valtype( oQry:rta_stamp )        return "C"


It has no error when I modified TXBrowse as your mention below.

Thanks a lot Mr.Rao
nageswaragunupudi wrote:Mr Dutch

Please help me with the results of :
? oQry:FieldType( <ntimestampfield> )
? ValType( oQry:FieldGet( <timestamefield> ) )

If both results are 'T' then please make this modification:
Locate method SetColFromMySQL(...) in xbrowse.prg.
Please change the line
Code: Select all  Expand view
  CASE cType       == 'D'

as
Code: Select all  Expand view
  CASE cType       $ 'DT'


If in the above test,
? ValType( oQry:FieldGet( <timestamefield> ) )
returns 'C' instead of 'T', please insert these two lines just before "OTHERWISE"
Code: Select all  Expand view
CASE cType == 'T'
                  cType := 'C'
 

I shall be glad if you can respond early.

PS: Regret I am not able to test myself as my development PC is under maintenance.
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: cValToStr() error *Fixed*

Postby Antonio Linares » Thu Jun 19, 2014 8:35 am

Dutch,

Did you just applied this ?

CASE cType $ 'DT'

thanks,

(Going to include it in FWH 14.06)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: cValToStr() error *Fixed*

Postby nageswaragunupudi » Thu Jun 19, 2014 9:21 am

Antonio Linares wrote:Dutch,

Did you just applied this ?

CASE cType $ 'DT'

thanks,

(Going to include it in FWH 14.06)

No.
Test results of Mr Dutch indicate that though Dolphin returns fiedtype as 'T', it actually returns a character value not DateTime value. So if Dolphin says the fieldtype is 'T', we should consider it as 'C'.
So the fix must be:
Code: Select all  Expand view

CASE cType == 'T'
     cType := 'C'
     nLen   := 19

 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: cValToStr() error *Fixed*

Postby Antonio Linares » Thu Jun 19, 2014 9:23 am

Rao,

Thanks for the clarification :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests