ADO RDD xHarbour

Re: ADO RDD xHarbour

Postby AHF » Wed Mar 11, 2015 11:19 am

Antonio,

Tried it again. Same error.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Wed Mar 11, 2015 12:02 pm

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
regards, saludos

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

Re: ADO RDD xHarbour

Postby Antonio Linares » Wed Mar 11, 2015 12:03 pm

regards, saludos

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

Re: ADO RDD xHarbour

Postby AHF » Wed Mar 11, 2015 3:41 pm

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

Re: ADO RDD xHarbour

Postby Antonio Linares » Wed Mar 11, 2015 9:11 pm

Antonio,

What harbour version are you using ?
regards, saludos

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

Re: ADO RDD xHarbour

Postby AHF » Thu Mar 12, 2015 7:50 am

AHF wrote:Antonio,

Im working with FWH October 2008 and xHarbour Sept 2008 .

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

Re: ADO RDD xHarbour

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

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

Re: ADO RDD xHarbour

Postby AHF » Thu Mar 12, 2015 2:49 pm

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

Re: ADO RDD xHarbour

Postby AHF » Thu Mar 12, 2015 3:55 pm

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

Re: ADO RDD xHarbour

Postby Antonio Linares » Fri Mar 13, 2015 7:50 am

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

Re: ADO RDD xHarbour

Postby Antonio Linares » Fri Mar 13, 2015 7:51 am

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

Re: ADO RDD xHarbour

Postby Antonio Linares » Fri Mar 13, 2015 7:52 am

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

Re: ADO RDD xHarbour

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

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

Re: ADO RDD xHarbour

Postby AHF » Fri Mar 13, 2015 10:26 am

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

Re: ADO RDD xHarbour

Postby AHF » Mon Mar 16, 2015 8:33 am

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

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 15 guests