PC Review


Reply
Thread Tools Rate Thread

DB Search method

 
 
Pipo
Guest
Posts: n/a
 
      11th Feb 2005
Hi RSusanto,

For finding what?
Records?
just perform a query, something like SELECT * FROM yourtable WHERE
SearchValue = ....

"RSusanto" <(E-Mail Removed)> wrote in message
news:u%23SFaz%(E-Mail Removed)...
> Hi,
>
> Anybody have idea what is the best method to search in the access database

?
>
>
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?QnJpYW4gQnJvd24=?=
Guest
Posts: n/a
 
      11th Feb 2005
Hi,

Can you be more specific? What are you searching for? Can you give us a
breif description of what you are attempting? Please reply to this post with
the information so the group may assist you better.

Thanks
 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      12th Feb 2005
The first one is pure Structured Query Language. The second is a mix of SQL
and VB so there is more processing that has to be done to resolve the SQL.

The first one is better. Also, don't use InStr anymore. In .NET, string
objects have string methods:

dim x as string
dim y as integer
y = x.IndexOf(searchstring)

Similarly, rather than date/time functions (now(), time(), hour(), etc.) use
dateTime object methods, etc.



"RSusanto" <(E-Mail Removed)> wrote in message
news:uYTJh$(E-Mail Removed)...
> There are 2 type I tried,
>
> SELECT * FROM ..LIKE ...
> SELECT * FROM WHERE xx= INSTR(searchstring)
>
> now, which one of them is the best ?
>
> "Brian Brown" <(E-Mail Removed)> wrote in message
> news:E0CB56B1-D56B-40F1-BD00-(E-Mail Removed)...
>> Hi,
>>
>> Can you be more specific? What are you searching for? Can you give us a
>> breif description of what you are attempting? Please reply to this post

> with
>> the information so the group may assist you better.
>>
>> Thanks

>
>



 
Reply With Quote
 
RSusanto
Guest
Posts: n/a
 
      12th Feb 2005
Hi,

Anybody have idea what is the best method to search in the access database ?



 
Reply With Quote
 
RSusanto
Guest
Posts: n/a
 
      13th Feb 2005
There are 2 type I tried,

SELECT * FROM ..LIKE ...
SELECT * FROM WHERE xx= INSTR(searchstring)

now, which one of them is the best ?

"Brian Brown" <(E-Mail Removed)> wrote in message
news:E0CB56B1-D56B-40F1-BD00-(E-Mail Removed)...
> Hi,
>
> Can you be more specific? What are you searching for? Can you give us a
> breif description of what you are attempting? Please reply to this post

with
> the information so the group may assist you better.
>
> Thanks



 
Reply With Quote
 
=?Utf-8?B?QnJpYW4gQnJvd24=?=
Guest
Posts: n/a
 
      14th Feb 2005
Hi,

The first will perform fine as long as the columns that you are searching
are good candidates for an index in the database or if the dataset is not too
large.

Off the top of my head I do not see how the second method will work at all.
I believe that the InStr function in VB will return an integer specifying the
start position of the first occurance of a substring within a string. So if
you have this in your VB code:

"SELECT * FROM Employees WHERE FirstName = " & INSTR("A", "A really long
string goes here")

You actually get

SELECT * FROM Employees WHERE FirstName = 1

I think that you have the right idea here but the wrong implementation. You
can GREATLY reduce the amount of processing that Sql has to do if you limit
the search on the code/application side before you do the query. If you use
= instead of LIKE your query will return much faster and be less likely to
bog down other parts of the application.

If you have any questions or if I have misunderstood your question please
respond to this post and I will try to be more clear.

I hope this helps.
----------------


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best search method? Jery J. Microsoft Access 1 8th Jan 2009 12:29 AM
search method Atishoo Microsoft Excel Programming 3 24th Jun 2008 09:56 AM
Need a good search method for vBA. Patrick Microsoft Access 3 1st Apr 2004 01:41 PM
better search method jonny Microsoft Excel Programming 3 25th Feb 2004 09:57 AM
Re: search method references? Kay Microsoft Dot NET 0 4th Oct 2003 12:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:00 AM.