Solved

SQL & VB question

Posted on 1998-07-05
4
209 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
[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
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

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.

696 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