Board index » delphi » TAdoQuery.Locate problem

TAdoQuery.Locate problem

I have a TAdoQuery (MyQuery) with following properties:
CursorLocation: clUseServer
CursorType: ctDynamic
SQL: Select * from MyTable Order By IdField

IdField is AutoInc

I call MyQuery.Locate('IdField', AnyExistingValue, []), but Result is False.

What should I do make locate work properly?

 

Re:TAdoQuery.Locate problem


Quote
> What should I do make locate work properly?

Use a client cursor.

Locating on a single field results in calling the RecordSet's Find
method which (when used with a server cursor) operates on the
content of the current client cache only.

HTH
--
Vassil Nazarov
http://web.orbitel.bg/vassil/

Re:TAdoQuery.Locate problem


OK. But what is purpose of dynamic cursors?

Quote
"Vassil Nazarov" <vas...@mail.orbitel.bg> wrote in message

news:3baa7af1_2@dnews...
Quote
> > What should I do make locate work properly?

> Use a client cursor.

> Locating on a single field results in calling the RecordSet's Find
> method which (when used with a server cursor) operates on the
> content of the current client cache only.

> HTH
> --
> Vassil Nazarov
> http://web.orbitel.bg/vassil/

Re:TAdoQuery.Locate problem


Quote
> OK. But what is purpose of dynamic cursors?

With dynamic cursors every move operation like Next, Prior, etc.
fetches the requested record from the sever (no client cache).
As a result there's no support for bookmarks but you always see
changes made by other users. Dynamic cursors use lots of server
resources and are therefore not suitable for multi-user environments.

--
Vassil Nazarov
http://web.orbitel.bg/vassil/

Re:TAdoQuery.Locate problem


I make your setting my program. but I can not use CursorType: ctDynamic. I set
it after active adoquery . CursorType: ctDynamic
change with ctKeyset .
how can i set CursorType: ctDynamic.

thank you for help

Quote
Ivelin Salabashev wrote:
> I have a TAdoQuery (MyQuery) with following properties:
> CursorLocation: clUseServer
> CursorType: ctDynamic
> SQL: Select * from MyTable Order By IdField

> IdField is AutoInc

> I call MyQuery.Locate('IdField', AnyExistingValue, []), but Result is False.

> What should I do make locate work properly?

Re:TAdoQuery.Locate problem


Quote
>I make your setting my program. but I can not use CursorType: ctDynamic. I set
>it after active adoquery . CursorType: ctDynamic
>change with ctKeyset .
>how can i set CursorType: ctDynamic.

Just because you ask for ctDynamic does not mean you are going to get it.  The
Ole db provider you use still has to support Dynamic cursors.
If the cursor type is returned as ctKeyset then either your provider doesn't
support it or you have a combination of other parameters set that does not
support the ctDynamic cursor type.
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads