ADO RDD xHarbour

AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

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

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ADO RDD xHarbour

Post by Antonio Linares »

Antonio,

Please replace this line in AdoRdd.prg:

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

with this:

Code: Select all

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
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ADO RDD xHarbour

Post by Antonio Linares »

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
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ADO RDD xHarbour

Post by Antonio Linares »

Antonio,

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

Antonio Linares
www.fivetechsoft.com
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Antonio,

Sent to your email.
Regards
Antonio H Ferreira
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ADO RDD xHarbour

Post by Antonio Linares »

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
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Sento as zop to 'alinares@fivetechsoft.com'
Regards
Antonio H Ferreira
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Antonio,

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

Re: ADO RDD xHarbour

Post by AHF »

Antonio,

Where can I find FWAdoFieldSize() and FWAdoFieldDec( ) ?
Regards
Antonio H Ferreira
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ADO RDD xHarbour

Post by Antonio Linares »

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: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ADO RDD xHarbour

Post by Antonio Linares »

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
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Antonio,

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

Email resent
Regards
Antonio H Ferreira
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ADO RDD xHarbour

Post by Antonio Linares »

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/ma ... ras/rddado
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply