Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL coding problem
Message
 
To
23/07/2000 23:32:11
Victor Lapid
Phil. Long Distance Tel. Co.
Manila, Philippines
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00396049
Message ID:
00396089
Views:
13
>Hi,
>
> I have this code in the textbox change event tha refreshes a grid during runtime and I found out that it becomes very slow when already accessing 5000 records in an access
>database.
> Data1.RecordSource = "select * from activity where date like'*" & TxtDate.Text & "*'"
> Data1.Refresh
> Is the problem basically in the code or VB's jet engine or the access database itself?
>
> TIA.

It is a bad idea to put this in the Change event. Every character pressed make the recordset to be rebuild!

Since you ask to enter a date, you should refresh your recordset only on the lost focus or when you know that the date is complete!

From what I see, you are using DAO. If you switch to ADO, you have the Filter method that doesn't need to get back to the database to filter the currently open recordset!
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform