Solved

SQL & VB question

Posted on 1998-07-05
4
188 Views
Last Modified: 2010-03-19
what is the most efficient way to open a recordset. Using jet I mad the following call:
stsql = "Select * from Catalog where descript like '*hello*' AND dealer < 50 AND stock > 1 AND DESCRIPT2 LIKE '*cd*'"
SET RECSET = DBS.OPENRECORDSET(STSQL)


Using RDO, I coded as follows After changing the * to %
set rs = cn.openresultset(stsql)
It does not seem to be terribly faster than JET, on Access. The table has 50,000 records, and is approx 8mb in size. The problem is that it is a network app, and lot's of differnt searches are done. Any suggestions, and/or comments would be appreciated. Thanks
0
Comment
Question by:redbaron082997
4 Comments
 
LVL 4

Expert Comment

by:vvk
ID: 1091663
What indexes you have on this table?
Try to use OLE interface to SQL server as described in SQL Books on-line or sqlole.hlp file.
0
 
LVL 9

Accepted Solution

by:
cymbolic earned 50 total points
ID: 1091664
It's not going to be terribly fast in any of the access methods, because from the looks of your query, a table scan is being used .  Anytime you use something like the "Like" operatoer and especially with masking, you are asking the server to look at all records to see which qualify.  There is no question that in continued use under all types of queries, an ODBC interface to SQL Server using RDO will be better and faster than using the Jet/DAO methods.

However, some queries are not very good under either methods, because they present no opportunity to the server of optimizing lookups using previously defined indexes.
0
 
LVL 1

Author Comment

by:redbaron082997
ID: 1091665
would using a stored procedure help?  All values being searched are indexed.
0
 

Expert Comment

by:rferly
ID: 1091666
I agree with the first anwer but if it helps I would add that you can use a like, providing you dont use a like "%something"

With a like "something%" the right index can be used by the optimiser
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

919 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now