New AdoRDD (free)

Postby Enrico Maria Giordano » Wed May 16, 2007 6:39 am

Milan Mehta wrote:Dear All,

I am quite excited about the possibility of Using Access and MySql in my program. I have always resisted using the same as I needed to alter my programming style and it also required some other program to be installed on client machine.


Please note that ADORDD uses ADO and therefore nothing changes on the side of the required components.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8417
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Wed May 16, 2007 7:00 am

Milan,

>
I will highly appreciate, if somebody can show me, how can I ?
- Create a Table (in a Database)
>

DbCreate(), please review the provided samples with ADORDD

> - Open the Table

USE ... please review ADORDD.ch

> - Index the Table

INDEX ON ... TO ...

> - Seek a particularly Value

SEEK ...

> - Set the filter

SET FILTER TO ...

ADORDD is used as another Harbour RDD, using the Clipper language syntax :-)
regards, saludos

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

Postby jose_murugosa » Wed May 16, 2007 12:28 pm

Antonio,

Does ADORDD work with Postgre SQL?

Is there any difference in sintax?
Saludos/Regards,
José Murugosa
FWH + Harbour + Bcc7. Una seda!
User avatar
jose_murugosa
 
Posts: 1145
Joined: Mon Feb 06, 2006 4:28 pm
Location: Uruguay

Postby Antonio Linares » Wed May 16, 2007 12:46 pm

José,

We have already answered you at the spanish forum :-)
regards, saludos

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

Postby Enrico Maria Giordano » Fri Jun 01, 2007 10:34 am

Is SEEK implemented. It seems not. If not, will it be? I think that ADORDD is not so useful without SEEK.

Same for locking. RLOCK() seems to always return .T.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8417
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Fri Jun 01, 2007 11:16 am

Enrico,

Please test this:

#define adSeek 0x200000

MsgInfo( HB_AdoRddGetRecordset():Supports( adSeek ) )

If the recordset does not support such functionality then there is no way to use SEEK using ADO. Its an ADO feature/limitation issue

Regarding the RLock():
Actually ADORDD returns true, because in fact the locking is handled by the server and depends on the open mode of the ADO Recordset
regards, saludos

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

Postby Enrico Maria Giordano » Fri Jun 01, 2007 12:33 pm

Antonio Linares wrote:Enrico,

Please test this:

#define adSeek 0x200000

MsgInfo( HB_AdoRddGetRecordset():Supports( adSeek ) )

If the recordset does not support such functionality then there is no way to use SEEK using ADO. Its an ADO feature/limitation issue


It returns .F. with MDB. Can you or anybody else test it under MySQL or MS SQL Server, please?

Anyway my question was if SEEK is currently implemented or will be in future.

Antonio Linares wrote:Regarding the RLock():
Actually ADORDD returns true, because in fact the locking is handled by the server and depends on the open mode of the ADO Recordset


I know. Do you have any ideas on how to prevent two users working on the same record (ie. opening the same dialog) at the same time?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8417
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Fri Jun 01, 2007 3:35 pm

Enrico,

>
It returns .F. with MDB. Can you or anybody else test it under MySQL or MS SQL Server, please?
>

Rick Lipkin tested Supports( adIndex ) with MS SQL Server and returned false too. Rick, could you test Supports( adSeek ) ? Thanks,

>
Anyway my question was if SEEK is currently implemented or will be in future.
>

Its not currently implemented, but its very easy, just one line source code:

http://www.w3schools.com/ado/met_rs_seek.asp

> Do you have any ideas on how to prevent two users working on the same record (ie. opening the same dialog) at the same time?

Probably the easiest way is to add a field "Locked" and turn it true or false
regards, saludos

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

Postby Enrico Maria Giordano » Fri Jun 01, 2007 3:53 pm

Antonio Linares wrote:Rick Lipkin tested Supports( adIndex ) with MS SQL Server and returned false too. Rick, could you test Supports( adSeek ) ?


I'm interested in MySQL support. Anybody that is using it?

Antonio Linares wrote:Its not currently implemented, but its very easy, just one line source code:

http://www.w3schools.com/ado/met_rs_seek.asp


I wonder how can SEEK work if SET INDEX doesn't. Maybe both are working with MySQL?

Antonio Linares wrote:Probably the easiest way is to add a field "Locked" and turn it true or false


I know. But there is a problem: if a terminal crash then the lock is stucked to true.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8417
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Fri Jun 01, 2007 4:01 pm

Enrico,

> I know. But there is a problem: if a terminal crash then the lock is stucked to true.

A remote procedure may help on that circunstance
regards, saludos

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

Postby Enrico Maria Giordano » Fri Jun 01, 2007 4:03 pm

Interesting. Can you be more explicit?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8417
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Fri Jun 01, 2007 4:06 pm

Enrico,

Its just an idea, I have not tried it and don't know if it may be a valid solution
regards, saludos

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

Postby Enrico Maria Giordano » Fri Jun 01, 2007 4:12 pm

Ah, ok. Thanks anyway.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8417
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Rick Lipkin » Fri Jun 01, 2007 10:10 pm

Antonio and Enrico

To the best of my knowledge MS SQL ( for a fact ) and Oracle databases do not use indexes in a traditional way and ADO can not access them for a seek ..

I have found that the plain old oRs:Find( cSQL ) works just fine and is VERY fast !! ( 30k records running over a T1 wan ) .. something like this code snipit Enrico helped me with :

oRs:MoveFirst()
oRs:Find("reg_no = '"+cFIND+"'" )

IF oRs:eof
oRs:MoveFirst()

xFIND := "reg_no like '"+cFIND+"%'"
oRs:Find( xFIND )

IF oRs:eof()
Msginfo( "Reg Number "+cFind+" can not be found" )
oRs:MoveFirst()
ENDIF
ENDIF

This code seems to work on .mdb and SQL Server and I venture to guess all ADO databases .. and to me would be the best common denominator for wrapping ( seek ) into Ado RDD ..

Just my thoughts
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2642
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby Enrico Maria Giordano » Fri Jun 01, 2007 10:33 pm

Rick Lipkin wrote:oRs:MoveFirst()
oRs:Find("reg_no = '"+cFIND+"'" )


Great! Then it seems that SEEK can be implemented via Find() method without the need of SET INDEX. One could eventually add indexes to database to speed up the search.

Antonio?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8417
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 136 guests