ADO RDD xHarbour

Re: ADO RDD xHarbour

Postby Antonio Linares » Tue Mar 24, 2015 9:10 pm

very good :-)

I really wish that this ADO RDD gets completed and you are doing a great job :-)

AdoRdd will become a great tool for harbour/xHarbour users
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 » Wed Mar 25, 2015 10:24 am

Antonio,

Do you have idea what function OrdKeyNo and OrdKeyCount are calling in RDD ?

Can you help me find that ?

I cannot find it!

Concerning the indexes with FOR clause to be transformed to WHERE clause for SQL. Is it common to be used in predefined indexes or only temporary indexes?
In our app we use it only in temporary indexes thus in the array of predefined indexes this situation is not forseen.

Do yo think its worth to cover it also?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Wed Mar 25, 2015 1:09 pm

Antonio,

Code: Select all  Expand view  RUN
HB_FUNC( ORDKEYNO )
{
   AREAP pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer();

   if( pArea )
   {
      DBORDERINFO pOrderInfo;
      memset( &pOrderInfo, 0, sizeof( pOrderInfo ) );
      pOrderInfo.itmOrder = hb_param( 1, HB_IT_STRING | HB_IT_NUMERIC );
      pOrderInfo.atomBagName = hb_param( 2, HB_IT_STRING );
      /* Either or both may be NIL */
      pOrderInfo.itmNewVal = NULL;
      pOrderInfo.itmResult = hb_itemPutNL( NULL, 0 );
      SELF_ORDINFO( pArea, DBOI_POSITION, &pOrderInfo );
      hb_itemReturnRelease( pOrderInfo.itmResult );
   }
   else
      hb_errRT_DBCMD( EG_NOTABLE, EDBCMD_NOTABLE, NULL, HB_ERR_FUNCNAME );
}
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 » Wed Mar 25, 2015 1:10 pm

Code: Select all  Expand view  RUN
HB_FUNC( ORDKEYCOUNT )
{
   AREAP pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer();

   if( pArea )
   {
      DBORDERINFO pOrderInfo;
      memset( &pOrderInfo, 0, sizeof( pOrderInfo ) );
      pOrderInfo.itmOrder = hb_param( 1, HB_IT_STRING | HB_IT_NUMERIC );
      pOrderInfo.atomBagName = hb_param( 2, HB_IT_STRING );
      /* Either or both may be NIL */

      pOrderInfo.itmResult = hb_itemPutNL( NULL, 0 );
      SELF_ORDINFO( pArea, DBOI_KEYCOUNT, &pOrderInfo );
      hb_itemReturnRelease( pOrderInfo.itmResult );
   }
   else
      hb_errRT_DBCMD( EG_NOTABLE, EDBCMD_NOTABLE, NULL, HB_ERR_FUNCNAME );

}
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 » Wed Mar 25, 2015 1:11 pm

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 » Wed Mar 25, 2015 1:12 pm

FOR clause could be saved as a string and when you issue a SELECT command then you append FOR ...

SELECT * FROM customers FOR ...
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 » Wed Mar 25, 2015 2:01 pm

Antonio,

Thanks I think see it now its ORDINFO :D

All locking already finished and it seems 100% compatible :D

FOR and UNIQUE on indexes are working
Its translate to WHERE clause and DISTINCT CLAUSE in selects. :lol:

We are now taking care of :

SCOPES to SELECT WHERE field BETWEEN value1 AND value2

Index clause NEXT translate to TOP n but for ex Oracle its ROWNUM we are checking how to solve these diferences between different SQLs

SEEK and FIND

SQLPARSER that we use already in other applications for ADS that transforms a normal old clipper filter expression to SQL SELECT taking in consideration active index.

I have a deadline for this part of the project to 27.03 so I hope to have all done till Friday and Ill post "clean" code after.

Still Fieldinfo its not working as we want. There are still problems with lenght and decimal places of DBF numeric fields types.

Can you find out with Mr Rao how to know or force that all recordsets are opened with the same connection obj.
This is imperative for transactions for locking concurrency

Now we ve a demand to prevent 100% SQL INJECTION. I have to study this ? Do you or Mr Rao have any ideas?

Cross your fingers as the most dificult part is still to come (RELATIONS)
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Wed Mar 25, 2015 2:12 pm

Antonio,

I just sent an email to Mr. Rao asking him for his help.

You have all my support, hopefully you complete it :-)
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 » Wed Mar 25, 2015 2:46 pm

Antonio,

Mr. Rao already answered me this:

1) Syntax of USE ... and DBUSEAREA.
2) Is the recordset opened by the ADORDD? If so how does the ADORDD knows the connection object? If ADORDD opens the recordset, does it open with connectionstring or a connection object?


Please answer whatever you know regarding these questions, 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 » Wed Mar 25, 2015 3:17 pm

Antonio,

1) Syntax of USE ... and DBUSEAREA.


Exactly the same as for other Rdds

2) Is the recordset opened by the ADORDD?


Yes. With ADO_OPEN( nWA, aOpenInfo )

If so how does the ADORDD knows the connection object?


Its ADRDD that opens the connection object each time USE gets called
aWAData[ WA_CONNECTION ] := TOleAuto():New( "ADODB.Connection" )

If ADORDD opens the recordset, does it open with connectionstring or a connection object?


It does it with connection object opened as indicated above.
oRecordSet:Open( aWAData[ WA_TABLENAME ], aWAData[ WA_CONNECTION ])

The problem is if I save the connection object in a STATIC var and I use it for the next call to open new recordset the app crashes.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Wed Mar 25, 2015 3:21 pm

Antonio,

Do you mean this value ?

aWAData[ WA_CONNECTION ]

so you can't reuse it ?

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 Antonio Linares » Wed Mar 25, 2015 3:23 pm

Maybe you are closing it somewhere ?
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 » Wed Mar 25, 2015 3:59 pm

Antonio,

The object its saved in the STATIC oADODB and its not released elsewere.

Code: Select all  Expand view  RUN


STATIC oADODB :=""

FUNCTION ADO_OPEN(.....
   IF EMPTY(oADODB)  //only first time
       aWAData[ WA_CONNECTION ] :=  TOleAuto():New( "ADODB.Connection" )
       aWAData[ WA_CONNECTION ]:OPEN(.....
       oADODB := aWAData[ WA_CONNECTION ]
   ELSE
        aWAData[ WA_CONNECTION ] :=oADODB
   ENDIF  
   oRecordSet :=  TOleAuto():New( "ADODB.Recordset" )
   oRecordSet:Open( aWAData[ WA_TABLENAME ], oADODB)

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

Re: ADO RDD xHarbour

Postby Antonio Linares » Wed Mar 25, 2015 4:05 pm

Antonio,

Where is it crashing ?

Have you traced the code to check where it crashes ?

Please place some MsgInfo()s or use OutputDebugString( cMsg ) (remember to load dbwin32.exe first).
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 » Wed Mar 25, 2015 4:08 pm

Antonio,

oRecordSet:Open(...
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 31 guests