Solved

Fast Queries

Posted on 1998-08-07
3
248 Views
Last Modified: 2012-05-04
I have written a program using RDO objects that use odbc etc to access a database. I find however that the queries are very slow. The following is a sample of the type of code im using:
Dim qd as rdoQuery
Set qd = cn.CreateQuery("qd",SQL)
qd.MaxRows = nRowCount
Set rs = qd.OpenResultset(rdOpenKeyset)
while rs.stillexecuting
   DoEvents
wend

Can anyone give me a few tips on how to speed up my queries?
0
Comment
Question by:Coates
3 Comments
 
LVL 14

Expert Comment

by:waty
ID: 1468236
I think you have forgot to set your query 'rdAsyncEnable'

Set rs = qd.OpenResultset(rdOpenKeyset, rdOpenForwardOnly, , rdAsyncEnable)

0
 
LVL 2

Expert Comment

by:percosolator
ID: 1468237
show us a couple of sample queries. Your problem more than is more than likely going to lie within the query.

RDO is faster than both DAO and data-bound objects.  If you have extensive outter joins, then you are probably going to see some performance problems.

Other pertinent information:  table structures, number of records, etc...
0
 

Accepted Solution

by:
newlook earned 40 total points
ID: 1468238
Properly index your SQL and ensure that your query uses that
index (try running direct to the database outside vb)
understand your databases optimizer - you didnt specify which
database you were using, but for example oracle uses a complex
optimizer which can be cost or rule based - understanding how
it processes your query and coding your sql to take advantage
will significantly speed it up.
Check your joins (if any) - make sure you are not getting a
cartesian product

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

830 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