?
Solved

Fast Queries

Posted on 1998-08-07
1
Medium Priority
?
137 Views
Last Modified: 2010-04-30
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
[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
1 Comment
 
LVL 9

Accepted Solution

by:
cymbolic earned 160 total points
ID: 1468239
Some options for you:

Consider the use of the Client Batch cursor library (rdUseCLientBatch).

Use a stored procedure rather than in line SQL.

Use a Use a forward only, readonly cursor, and update via a stored procedure or .execute methods.

If you have BLOB columns involved,  make sure you are not using the rdFetchLongColumns property to fetch them with other columns.  Get 'em later only if you need 'em.

Check your client machines.  Are there protocols installed in the protocol stack that are not being used?  This will slow everything down as Windows gives them time to no result.

Are you performing major amounts of updates over time?  Issue periodic Update Statistics to SQL Server to rebuild query paths.

Check your underlying tables with DBCC.

Consider using simpler, multipass queries instead of a major joined query (very complex SQL).  Your own methodology and process generally outguesses the SQL Query processor.

Using joined queries from multiple tables?  Create views on SQL Server, then execute your queries against the views.

FInally, get and read "Hitchiker's Guide to Visual Basic & SQL Server" by W. R. Vaughn.  
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

771 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