Page 4 of 70

Re: ADO RDD xHarbour

PostPosted: Wed Mar 11, 2015 11:19 am
by AHF
Antonio,

Tried it again. Same error.

Re: ADO RDD xHarbour

PostPosted: Wed Mar 11, 2015 12:02 pm
by Antonio Linares
Lets review Harbour's usrrdd.c code:

Code: Select all  Expand view
HB_FUNC_UR_SUPER( ADDFIELD )
{
   AREAP pArea = hb_usrGetAreaParam( 2 );

   if( pArea )
   {
      DBFIELDINFO dbFieldInfo;

      if( hb_usrItemToFieldInfo( hb_param( 2, HB_IT_ARRAY ), &dbFieldInfo ) )
      {
         hb_retni( SUPER_ADDFIELD( pArea, &dbFieldInfo ) );
      }
      else
      {
         hb_usrErrorRT( pArea, EG_ARG, EDBCMD_NOVAR );
         hb_retni( HB_FAILURE );
      }
   }
}


It seems as hb_usrItemToFieldInfo( hb_param( 2, HB_IT_ARRAY ) takes the value from the array and fill a structure
Code: Select all  Expand view
static HB_BOOL hb_usrItemToFieldInfo( PHB_ITEM pItem, LPDBFIELDINFO pFieldInfo )
{
   if( pItem && hb_arrayLen( pItem ) == UR_FI_SIZE )
   {
      pFieldInfo->atomName       = hb_usrArrayGetCPtr( pItem, UR_FI_NAME );
      pFieldInfo->uiType         = ( HB_USHORT ) hb_arrayGetNI( pItem, UR_FI_TYPE );
      pFieldInfo->uiTypeExtended = ( HB_USHORT ) hb_arrayGetNI( pItem, UR_FI_TYPEEXT );
      pFieldInfo->uiLen          = ( HB_USHORT ) hb_arrayGetNI( pItem, UR_FI_LEN );
      pFieldInfo->uiDec          = ( HB_USHORT ) hb_arrayGetNI( pItem, UR_FI_DEC );
      return HB_TRUE;
   }
   return HB_FALSE;
}


5 elements

Re: ADO RDD xHarbour

PostPosted: Wed Mar 11, 2015 12:03 pm
by Antonio Linares

Re: ADO RDD xHarbour

PostPosted: Wed Mar 11, 2015 3:41 pm
by AHF
Antonio,

Passed array its corrected.This is the print out:

aField[ UR_FI_NAME ] = NRENCOMEND
aField[ UR_FI_TYPE ] = 1
aField[ UR_FI_TYPEEXT ] = 0
aField[ UR_FI_LEN ] = 10
aField[ UR_FI_DEC ] = 0


It seems the error its not here.

Re: ADO RDD xHarbour

PostPosted: Wed Mar 11, 2015 9:11 pm
by Antonio Linares
Antonio,

What harbour version are you using ?

Re: ADO RDD xHarbour

PostPosted: Thu Mar 12, 2015 7:50 am
by AHF
AHF wrote:Antonio,

Im working with FWH October 2008 and xHarbour Sept 2008 .

Is this the reason?

Re: ADO RDD xHarbour

PostPosted: Thu Mar 12, 2015 10:06 am
by AHF
Antonio,

I checked usrrdd.c from xHarbour and it expects aField[ UR_FI_FLAGS ] aField[ UR_FI_STEP ] that I now send := 0.


Its ok now :D

Will keep you posted

Re: ADO RDD xHarbour

PostPosted: Thu Mar 12, 2015 2:49 pm
by AHF
I save a password with functions FwEncrypt and Fwdecrypt but the charater returned doesnt correspond to what is in that field.

I think this has something to do with charset

Any solutions?

Re: ADO RDD xHarbour

PostPosted: Thu Mar 12, 2015 3:55 pm
by AHF
Antono,

There is a problem with the field:type.
When its dbf field "N" with 0 decimals it returns a double with 2 decimal places.
How can we make this conversion when uploading dbfs as tables for ex to mysql or working with dbfs directly ?

Re: ADO RDD xHarbour

PostPosted: Fri Mar 13, 2015 7:50 am
by Antonio Linares
AHF wrote:Antonio,

I checked usrrdd.c from xHarbour and it expects aField[ UR_FI_FLAGS ] aField[ UR_FI_STEP ] that I now send := 0.


Its ok now :D

Will keep you posted


Very good! :-)

Re: ADO RDD xHarbour

PostPosted: Fri Mar 13, 2015 7:51 am
by Antonio Linares
AHF wrote:Antono,

There is a problem with the field:type.
When its dbf field "N" with 0 decimals it returns a double with 2 decimal places.
How can we make this conversion when uploading dbfs as tables for ex to mysql or working with dbfs directly ?


Lets ask Mr. Rao about this as he is a great expert with SQL.

Re: ADO RDD xHarbour

PostPosted: Fri Mar 13, 2015 7:52 am
by Antonio Linares
AHF wrote:I save a password with functions FwEncrypt and Fwdecrypt but the charater returned doesnt correspond to what is in that field.

I think this has something to do with charset

Any solutions?


Try to use Harbour encrypt/decrypt functions to see if that solves the problem.

I don't remember right now the exact names that those functions have.

Re: ADO RDD xHarbour

PostPosted: Fri Mar 13, 2015 9:54 am
by AHF
Antonio,

The application crashes without any error in the following condition:

ACTIVATE WINDOW … ON INIT initial() …


Function Initial()

Use dbf
Do while !eof()

…..
Dbskip()
Enddo

If the same function is called out of ON INIT clause its ok.

If I call browse() before the Do While in any condition its ok

The crash occours in the oRecordSet:move(nTotSkip) in ADO_SKIPRAW() inside the do while og Initial().

What might be the problem?

Re: ADO RDD xHarbour

PostPosted: Fri Mar 13, 2015 10:26 am
by AHF
Antonio Linares wrote:
AHF wrote:I save a password with functions FwEncrypt and Fwdecrypt but the charater returned doesnt correspond to what is in that field.

I think this has something to do with charset

Any solutions?


Try to use Harbour encrypt/decrypt functions to see if that solves the problem.

I don't remember right now the exact names that those functions have.


Antonio,

The first password was created with ADS.
ADORDD returns wrong chars.
This is a charset problem because if I reset the password with ADORDD a create a new one its ok!

How can I change the charset in ADO to be the same of ADS being ADS Collation=ansi or OEM character set = PORTUGUE Ansi CHARATER SET = Portuguese ?

Re: ADO RDD xHarbour

PostPosted: Mon Mar 16, 2015 8:33 am
by AHF
Antonio,

Can you test this and confirm it?

AHF wrote:Antonio,

The application crashes without any error in the following condition:

ACTIVATE WINDOW … ON INIT initial() …


Function Initial()

Use dbf
Do while !eof()

…..
Dbskip()
Enddo

If the same function is called out of ON INIT clause its ok.

If I call browse() before the Do While in any condition its ok

The crash occours in the oRecordSet:move(nTotSkip) in ADO_SKIPRAW() inside the do while og Initial().

What might be the problem?