Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

locate method on ADODataset

Posted on 2001-09-18
10
Medium Priority
?
1,112 Views
Last Modified: 2008-02-07
Hi,

I have a filtered ADODataset and Im calling the locate method on it. I am finding that the method is not working consistently - sometimes it returns TRUE even when I know a record does not exist. I also get the BOF or EOF error when calling locate on an empty dataset. I have applied the ADO update patch for Delphi 5 and still get the quirky behaviour.

Any feedback or tips regarding using locate on a filtered adodataset will be welcomed.

0
Comment
Question by:benjvr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 6490490
Hi benjvr,

This seems to be a problem that has occured with ADO since day one.  I've never got it to work consistently.  I just use the standard TTable instead.  That works fine.

Stu
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6490512
Hello
 
  locate working fine with me, which database you are using?

  and try to filter ur data using SQL (from commandtext property) instead of filter property, and try that again

Best regards
Mohammed Nasman
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6490526
I mean by using SQL using where clause in the commandtext property)

 ADODataSet1.CommandText := 'select * from customers where city = "anycity"';
  ADODataSet1.Open;
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 44

Expert Comment

by:CrazyOne
ID: 6490635
Yeah ADO locate doesn't work consistently for me either using MS Access, mainly on text fields.


The Crazy One
0
 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 6490636
Hi Mohammed,

It does work, but not all the time.  Sometimes the result will return false even when we know that the locate should work.  It's not reliable enough to be get a constant result.

I've only tried it from MS Access 97, 2000 and SQL Server 7.0.  It may work fine with other DBs.

Cheers!

Stu.

PS.  Sorry benjvr - I guess it sounds like I'm hogging the question, but it's not intentional.  I'm just adding my thoughts in as we both seem to be having the same problem.
0
 
LVL 6

Accepted Solution

by:
Stuart_Johnson earned 800 total points
ID: 6490649
Just a thought, I heard a while ago that ADO Express (the standard version shipped with D5) was buggy.  Have you upgraded your ADO Express at all (available to download from Borlands website)?  Also, installing MDAC 2.5+ maybe an advantage.

When I was developing an MTS component, I had all sorts of problems with ADO Express.  I ended up importing the ADO type library (\program files\common files\system\ado) and used that.  It takes a bit longer to code around, but it stopped all the errors!!

Cheers,

Stu.
0
 

Expert Comment

by:omavideniz
ID: 6861196
It is a bug in the Locate method.

Here you can find a good and free component which corrects this bug and others:
http://web.orbitel.bg/vassil/
0
 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 6862694
Seeing as though this question has been posted in again, I might ask the benjvr if he has solved the problem, or if any of our suggestions have worked.  I'm still standing by my orginal post.

Stu.
0
 
LVL 17

Expert Comment

by:geobul
ID: 9308608
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

accept Stuart Johnson's comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question