ADO RDD xHarbour

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

Re: ADO RDD xHarbour

Post by AHF »

Antonio,

Tried it again. Same error.
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 »

Lets review Harbour's usrrdd.c code:

Code: Select all

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

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
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 »

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,

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.
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,

What harbour version are you using ?
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 »

AHF wrote:Antonio,

Im working with FWH October 2008 and xHarbour Sept 2008 .

Is this the reason?
Regards
Antonio H Ferreira
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

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

Re: ADO RDD xHarbour

Post 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?
Regards
Antonio H Ferreira
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post 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 ?
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 »

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! :-)
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: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.
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: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.
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,

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

Re: ADO RDD xHarbour

Post 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 ?
Regards
Antonio H Ferreira
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post 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?
Regards
Antonio H Ferreira
Post Reply