ADO RDD xHarbour
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: ADO RDD xHarbour
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
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
Re: ADO RDD xHarbour
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?
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
Antonio H Ferreira
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: ADO RDD xHarbour
Antonio,
Code: Select all
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 );
}
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: ADO RDD xHarbour
Code: Select all
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 );
}
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: ADO RDD xHarbour
FOR clause could be saved as a string and when you issue a SELECT command then you append FOR ...
SELECT * FROM customers FOR ...
SELECT * FROM customers FOR ...
Re: ADO RDD xHarbour
Antonio,
Thanks I think see it now its ORDINFO
All locking already finished and it seems 100% compatible
FOR and UNIQUE on indexes are working
Its translate to WHERE clause and DISTINCT CLAUSE in selects.
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)
Thanks I think see it now its ORDINFO
All locking already finished and it seems 100% compatible
FOR and UNIQUE on indexes are working
Its translate to WHERE clause and DISTINCT CLAUSE in selects.
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
Antonio H Ferreira
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: ADO RDD xHarbour
Antonio,
I just sent an email to Mr. Rao asking him for his help.
You have all my support, hopefully you complete it
I just sent an email to Mr. Rao asking him for his help.
You have all my support, hopefully you complete it
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: ADO RDD xHarbour
Antonio,
Mr. Rao already answered me this:
Mr. Rao already answered me this:
Please answer whatever you know regarding these questions, thanks1) 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?
Re: ADO RDD xHarbour
Antonio,
aWAData[ WA_CONNECTION ] := TOleAuto():New( "ADODB.Connection" )
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.
Exactly the same as for other Rdds1) Syntax of USE ... and DBUSEAREA.
Yes. With ADO_OPEN( nWA, aOpenInfo )2) Is the recordset opened by the ADORDD?
Its ADRDD that opens the connection object each time USE gets calledIf so how does the ADORDD knows the connection object?
aWAData[ WA_CONNECTION ] := TOleAuto():New( "ADODB.Connection" )
It does it with connection object opened as indicated above.If ADORDD opens the recordset, does it open with connectionstring or a connection object?
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
Antonio H Ferreira
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: ADO RDD xHarbour
Antonio,
Do you mean this value ?
aWAData[ WA_CONNECTION ]
so you can't reuse it ?
thanks
Do you mean this value ?
aWAData[ WA_CONNECTION ]
so you can't reuse it ?
thanks
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: ADO RDD xHarbour
Maybe you are closing it somewhere ?
Re: ADO RDD xHarbour
Antonio,
The object its saved in the STATIC oADODB and its not released elsewere.
The object its saved in the STATIC oADODB and its not released elsewere.
Code: Select all
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
Antonio H Ferreira
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: ADO RDD xHarbour
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).
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).