ADO RDD xHarbour

Re: ADO RDD xHarbour

Postby AHF » Thu Mar 05, 2015 10:06 am

MsgInfo( ADO_GETFIELDTYPE( oRecordSet:Fields( n - 1 ):Type ) )
type char value returned 1
type date value returned 3
type numeric value returned 7
type logic value returned 2


Code: Select all  Expand view  RUN
STATIC FUNCTION ADO_GETFIELDTYPE( nADOFieldType )

   LOCAL nDBFFieldType := 0

   DO CASE

   CASE nADOFieldType == adEmpty
   CASE nADOFieldType == adTinyInt
      nDBFFieldType := HB_FT_INTEGER

   CASE nADOFieldType == adSmallInt
      nDBFFieldType := HB_FT_INTEGER

   CASE nADOFieldType == adInteger
      nDBFFieldType := HB_FT_INTEGER

   CASE nADOFieldType == adBigInt
      nDBFFieldType := HB_FT_INTEGER

   CASE nADOFieldType == adUnsignedTinyInt
   CASE nADOFieldType == adUnsignedSmallInt
   CASE nADOFieldType == adUnsignedInt
   CASE nADOFieldType == adUnsignedBigInt
   CASE nADOFieldType == adSingle

   CASE nADOFieldType == adDouble
      nDBFFieldType := HB_FT_DOUBLE

   CASE nADOFieldType == adCurrency
      nDBFFieldType := HB_FT_INTEGER

   CASE nADOFieldType == adDecimal
      nDBFFieldType := HB_FT_LONG

   CASE nADOFieldType == adNumeric
      nDBFFieldType := HB_FT_LONG


   CASE nADOFieldType == adError
   CASE nADOFieldType == adUserDefined
   CASE nADOFieldType == adVariant
      nDBFFieldType := HB_FT_ANY

   CASE nADOFieldType == adIDispatch

   CASE nADOFieldType == adIUnknown

   CASE nADOFieldType == adGUID
      nDBFFieldType := HB_FT_STRING

   CASE nADOFieldType == adDate
#ifdef HB_FT_DATETIME
      nDBFFieldType := HB_FT_DATETIME
#else
      nDBFFieldType := HB_FT_DATE
#endif

   CASE nADOFieldType == adDBDate
#ifdef HB_FT_DATETIME
      nDBFFieldType := HB_FT_DATETIME
#else
      nDBFFieldType := HB_FT_DATE
#endif

   CASE nADOFieldType == adDBTime

   CASE nADOFieldType == adDBTimeStamp
      nDBFFieldType := HB_FT_TIMESTAMP

   CASE nADOFieldType == adFileTime
#ifdef HB_FT_DATETIME
      nDBFFieldType := HB_FT_DATETIME
#else
      //nDBFFieldType := HB_FT_DATE
#endif

   CASE nADOFieldType == adBSTR
      nDBFFieldType := HB_FT_STRING

   CASE nADOFieldType == adChar
      nDBFFieldType := HB_FT_STRING

   CASE nADOFieldType == adVarChar
      nDBFFieldType := HB_FT_STRING

   CASE nADOFieldType == adLongVarChar
      nDBFFieldType := HB_FT_STRING

   CASE nADOFieldType == adWChar
      nDBFFieldType := HB_FT_STRING

   CASE nADOFieldType == adVarWChar
      nDBFFieldType := HB_FT_STRING

   CASE nADOFieldType == adBinary
      nDBFFieldType := HB_FT_OLE

   CASE nADOFieldType == adVarBinary
      nDBFFieldType := HB_FT_OLE

   CASE nADOFieldType == adLongVarBinary
      nDBFFieldType := HB_FT_OLE

   CASE nADOFieldType == adChapter

   CASE nADOFieldType == adVarNumeric
/* CASE nADOFieldType == adArray */

   CASE nADOFieldType == adBoolean
      nDBFFieldType := HB_FT_LOGICAL

   CASE nADOFieldType == adLongVarWChar
      nDBFFieldType := HB_FT_MEMO

   CASE nADOFieldType == adPropVariant
      nDBFFieldType := HB_FT_MEMO

   ENDCASE

   RETURN nDBFFieldType
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Thu Mar 05, 2015 11:23 am

Antonio,

Please replace this line in AdoRdd.prg:

aField[ UR_FI_TYPE ] := ADO_GETFIELDTYPE( oRecordSet:Fields( n - 1 ):Type )

with this:

Code: Select all  Expand view  RUN

do case
     case  ADO_GETFIELDTYPE( oRecordSet:Fields( n - 1 ):Type == 1
             aField[ UR_FI_TYPE ]  :=  HB_FT_STRING

     case  ADO_GETFIELDTYPE( oRecordSet:Fields( n - 1 ):Type == 3
             aField[ UR_FI_TYPE ]  :=  HB_FT_DATE

     case  ADO_GETFIELDTYPE( oRecordSet:Fields( n - 1 ):Type == 7
             aField[ UR_FI_TYPE ]  := HB_FT_NUMERIC // if there are no decimals this should be HB_FT_INTEGER

     case  ADO_GETFIELDTYPE( oRecordSet:Fields( n - 1 ):Type == 2
             aField[ UR_FI_TYPE ]  := HB_FT_LOGICAL
endcase
 
regards, saludos

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

Re: ADO RDD xHarbour

Postby AHF » Thu Mar 05, 2015 2:25 pm

Antonio,

Error:

genCode 14: EG_NOVAR
operação HB_FT_NUMERIC

If I change it to HB_FT_INTEGER then I get the same error:

genCode 1: EG_ARG
severity 2
subCode 1003
subSystem ADORDD

Chamado de UR_SUPER_ADDFIELD(0)
Chamado de ADO_OPEN(448)
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Thu Mar 05, 2015 7:18 pm

Antonio,

Please add this include at the top of AdoRdd.prg

#include "hbusrrdd.ch"

and replace HB_FT_NUMERIC with HB_FT_DOUBLE

if HB_FT_DOUBLE fails, try it with HB_FT_INTEGER
regards, saludos

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

Re: ADO RDD xHarbour

Postby AHF » Thu Mar 05, 2015 10:50 pm

Antonio,

#include "hbusrrdd.ch" was already there.
HB_FT_NUMERIC its not defined in hbusrrdd.ch

Passing the FOR clause in the first field I get:

name user type 1 len 30

its correct according to dbf file. user c 30

Calling UR_SUPER_ADDFIELD( nWA, aField )

I get the same error:

arguments none
description Argument error
genCode 1: EG_ARG
osCode (Não é erro do sistema operativo)
severity 2
subCode 1003
subSystem ADORDD
tries 0
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Thu Mar 05, 2015 11:25 pm

Antonio,

Could you send me a small ZIP renamed as ZOP with the PRG and DBF ? thanks
regards, saludos

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

Re: ADO RDD xHarbour

Postby AHF » Fri Mar 06, 2015 9:13 am

Antonio,

Sent to your email.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Fri Mar 06, 2015 9:20 am

Antonio,

I have not received it yet.

Please remember to rename ZIPs as ZOPs or gmail will block them
regards, saludos

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

Re: ADO RDD xHarbour

Postby AHF » Fri Mar 06, 2015 9:26 am

Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Mon Mar 09, 2015 8:24 am

Antonio,

Did you received my email?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Mon Mar 09, 2015 9:29 am

Antonio,

Where can I find FWAdoFieldSize() and FWAdoFieldDec( ) ?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Mon Mar 09, 2015 11:12 am

Antonio,

I have not received your email

Please rename the attached files as *.zop or gmail will delete them
regards, saludos

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

Re: ADO RDD xHarbour

Postby Antonio Linares » Mon Mar 09, 2015 11:28 am

AHF wrote:Antonio,

Where can I find FWAdoFieldSize() and FWAdoFieldDec( ) ?


Those functions and much more are in FWH\source\function\adfuncs.prg
regards, saludos

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

Re: ADO RDD xHarbour

Postby AHF » Mon Mar 09, 2015 11:34 am

Antonio,

Im working with FWH October 2008 and xHarbour Sept 2008 and I dont have such functions.

Email resent
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Mon Mar 09, 2015 8:32 pm

Antonio,

It seems as you are not using the most recent adordd.prg.

Please try it with this one:

https://github.com/harbour/core/tree/master/extras/rddado
regards, saludos

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

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests