If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Optimize msAccess / MySQL search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-13-04, 04:16
Odders Odders is offline
Registered User
 
Join Date: Mar 2004
Location: UK
Posts: 15
Optimize msAccess / MySQL search

In my Access runtime applications I often include a ‘locator field’ search box to speed-up searches on tabular forms.

The user can choose (via radio buttons) which column field to search by and as each character is entered into a search box the record that matches the pattern will become the active record.

This has worked well up to now.

I am in the throws of replacing the mdb/mde backend with MySQL. The custom search has now become much slower!

I have included small snippets of the search code from different event handlers.

Code:
code:Private rsClone      As DAO.Recordset

 …

‘strField – field in tabular form to search by.
Screen.ActiveForm.subForm.Form.OrderBy = strField
    
'Create clone after datasheet has been sorted...
Set rsClone = Screen.ActiveForm.subForm.Form.RecordsetClone
rsClone.Sort = strFiel

…

‘strLoc - user entered search string.
If strLoc = "" Then		
   rsClone.MoveFirst
Else
   rsClone.FindFirst strSearch & " LIKE '" & strLoc & "*'"
End If
    
'Sync current record with clone...
If Not rsClone.NoMatch Then
   Screen.ActiveForm!subForm.Form.Bookmark = rsClone.Bookmark
Else
   ‘show not found message in status bar.
End If

…

How can I optimize it now that the tables are MySQL InnoDB?
Reply With Quote
  #2 (permalink)  
Old 04-13-04, 05:31
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
i have no idea what you're doing with that code

i just thought i'd point out that the wildcard character for the LIKE expression in mysql is % instead of *
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On