FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour New AdoRDD (free)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
New AdoRDD (free)
Posted: Wed May 16, 2007 06: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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
New AdoRDD (free)
Posted: Wed May 16, 2007 07: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
Posts: 1279
Joined: Mon Feb 06, 2006 04:28 PM
New AdoRDD (free)
Posted: Wed May 16, 2007 12:28 PM

Antonio,

Does ADORDD work with Postgre SQL?

Is there any difference in sintax?

Saludos/Regards,

José Murugosa

"Los errores en programación, siempre están entre la silla, el teclado y la IA!!"
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
New AdoRDD (free)
Posted: Wed May 16, 2007 12:46 PM

José,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
New AdoRDD (free)
Posted: 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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
New AdoRDD (free)
Posted: 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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
New AdoRDD (free)
Posted: 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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
New AdoRDD (free)
Posted: Fri Jun 01, 2007 03: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
New AdoRDD (free)
Posted: Fri Jun 01, 2007 03: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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
New AdoRDD (free)
Posted: Fri Jun 01, 2007 04: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
New AdoRDD (free)
Posted: Fri Jun 01, 2007 04:03 PM

Interesting. Can you be more explicit?

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
New AdoRDD (free)
Posted: Fri Jun 01, 2007 04: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
New AdoRDD (free)
Posted: Fri Jun 01, 2007 04:12 PM

Ah, ok. Thanks anyway.

EMG

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
New AdoRDD (free)
Posted: 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

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
New AdoRDD (free)
Posted: 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