Board index » delphi » Implementing Findkey in ADO

Implementing Findkey in ADO

I wonder what kept Borland from incorporating Findkey function into ADO and
IB-Express. It is a nice little {*word*60}ive function that actually saves a lot
of time on a developer's end. If small libs such as Titan can incorporate it
in Titan Access and Jason can do it in IBObjects, what kept Borland from
incorporating it into ADOExpress or IBExpress libs ? Will it be part of
ADOExpress or IBExpress in future releases ?

Tauseef

 

Re:Implementing Findkey in ADO


I'm quite new to ADO, just using it for a customer who wants data to be
stored as an Access 2000 DB (local). Since ADO will also relieve me to
distribute the BDE with my app, this is fine.

Doing this, I noticed that the FindKey function does not exist for ADO
tables, but there is a Seek function that does exactly the same, as far as I
understood it. The problem is that whenever I try to use it on my Access 2K
DB, I get an exception saying that the server does not support this
function.

I've worked around this problem using the Locate function, which is supposed
to use indexes when they mat help the search. At least, this what is said
about the *BDE* Locate function. Is it the same for Access provider ? If
not, I can't see a way for fast record search.

Have I made something wrong ? Any suggestion ?

Regards
Eric Pascual

"Tauseef" <tsha...@isb.paknet.com.pk> a crit dans le message news:
3a8a1147_1@dnews...

Quote
> I wonder what kept Borland from incorporating Findkey function into ADO
and
> IB-Express. It is a nice little {*word*60}ive function that actually saves a
lot
> of time on a developer's end. If small libs such as Titan can incorporate
it
> in Titan Access and Jason can do it in IBObjects, what kept Borland from
> incorporating it into ADOExpress or IBExpress libs ? Will it be part of
> ADOExpress or IBExpress in future releases ?

> Tauseef

Re:Implementing Findkey in ADO


Quote
>Seek function that does exactly the same, as far as I
>understood it. The problem is that whenever I try to use it on my Access 2K
>DB, I get an exception saying that the server does not support this
>function.

You need to set CursorLocation = clUseServer and TableDirect to True
and have an IndexName to use Seek
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Implementing Findkey in ADO


Brian,

I've tried this (since I found a post of yours in this NG about the same
kind of pb), but it does not work.

If I set CursorLocation to clUserServer, trying to open the table fails with
the same error message (ie. not handled by the provider or something
similar).

I'm working with D5 C/S UP1 and Access 2000, under Win2K SP1.

Any idea ?

Thanks in advance and best regards
Eric Pascual

"Brian Bushay TeamB" <BBus...@Nmpls.com> a crit dans le message news:
9su39tcprcn1iqme7pqgvd1n5k6ghfv...@4ax.com...

Quote

> >Seek function that does exactly the same, as far as I
> >understood it. The problem is that whenever I try to use it on my Access
2K
> >DB, I get an exception saying that the server does not support this
> >function.
> You need to set CursorLocation = clUseServer and TableDirect to True
> and have an IndexName to use Seek
> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Re:Implementing Findkey in ADO


Quote
>If I set CursorLocation to clUserServer, trying to open the table fails with
>the same error message (ie. not handled by the provider or something

I don't know what other combination of properties you are trying to set that
make ClUseServer a problem

I don't have any problems using ClUsserver on and Access 2000 table
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Implementing Findkey in ADO


Brian,

I've found the circumstances under which the problem arises. If the
IndexFieldNames is set, then trying to changed Active to True while
CursorLocation is clUseServer generated the error message I mentionned. If
IndexFieldNames is empty, there is no problem.

However, if the IndexName is set, as soon as you set the Active property to
true, the IndexFieldNames property is automatically updated, according to
the definition of the specified index. So if you close the table, and then
try to reopen it, without clearing IndexFieldNames, the error message is
displayed again. In other words, you'll need to clear IndexFieldNames before
reopening the table.

All these manipulations can be done in design mode.

Eric

"Brian Bushay TeamB" <BBus...@Nmpls.com> a crit dans le message news:
sne69tos7cr75dftuecueur8olqf4o8...@4ax.com...

Quote

> >If I set CursorLocation to clUserServer, trying to open the table fails
with
> >the same error message (ie. not handled by the provider or something
> I don't know what other combination of properties you are trying to set
that
> make ClUseServer a problem

> I don't have any problems using ClUsserver on and Access 2000 table
> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Other Threads