Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL coding problem
Message
 
À
23/07/2000 23:32:11
Victor Lapid
Phil. Long Distance Tel. Co.
Manila, Philippines
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00396049
Message ID:
00396089
Vues:
12
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform