Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

ADO slower than ODBC?

Posted on 2003-02-19
5
Medium Priority
?
295 Views
Last Modified: 2013-11-23
Hi

In my Delphi 6 app, I am accessing a table on a MS SQL server with a little over 1 million records (Stock transactions). When I access it with ADO (tAdoQuery) with Cursorlocation = clUseClient it takes forever to open the dataset, and I need to use clUseClient in order to browse the dataset.

If I access the table through an ODBC datasource using TQuery it is a least 10 times faster to open the table and I can still browse the dataset.

I want to use ADO because it is easier to distribute, but how do I speed it up?

Thanks in advance
0
Comment
Question by:Landlyst
4 Comments
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 300 total points
ID: 7986053
Hello
 
  In much cases ADO is faster than ODBC, but the way you are using it will make the different in performace

  for example, you are using Cursorlocation = clUseClient, this mean that all the data will cached to the client, so this will take very long time with big tables, you should use where clause to return the records needed but not all the table

  also try to make the cursorlocation to be on server

  but always try to return specific records, not all the record

Best regards
Mohammed Nasman
0
 

Expert Comment

by:miroslavp
ID: 7986329
Hi,

With ADO be carefully with connections. They are very slow on opening… If you make often close/open connection this will hit your performance. Open connection on start of your application and close it on exit.
And of course if your SELECT return millions of records and you use client cursor and your database is over network you must wait from minutes to hours for transferring all records over network to your client machine.

TIA,
Miro.
0
 

Expert Comment

by:CleanupPing
ID: 9317170
Landlyst:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 10

Expert Comment

by:kacor
ID: 9928525
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 for this question:
       to accept mnasman's answer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Some days and here is the Christmas Time. I wish good luck and good health for you all and for your loved ones

kacor
EE Cleanup Volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

572 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