>Hello,
>
>I am using Visual FoxPro 6.0. I am making a search-form. On that search form there are a couple of textboxes, a search-button and a grid. If I fill in the textboxes and press the search-button a SELECT-command is being executed and the result of the search will be showed in the grid. This is all working fine, but there is only one problem. The problem is that it is taking to long to show the results.
>
>The SELECT-command is using a couple of tables at the same time. The main table, 23000 records, has some fields with only numbers in them. Those numbers are also stored in sub-tables along with the descriptions of the numbers. Those descriptions has to be showed in the grid. The problem is that it is taking to long to show the results. Is there something I am doing wrong? Or is there a faster way to show the results. The SELECT-command I am using is located at the end of this message. Thank you in advance for your time.
>
>SELECT Bedrijf.DossierNr, ;
> UPPER(Bedrijf.BedrNaam), ;
> UPPER(Straat.Om), ;
> ALLTRIM(Bedrijf.Nummer), ;
> StatBedr.Om_NL, ;
> VestType.Om_NL ;
>FROM Bedrijf, ;
> Straat, ;
> StatBedr, ;
> VestType ;
>WHERE Bedrijf.Straat = Straat.Straat ;
> AND Bedrijf.StatBedr = StatBedr.StatBedr ;
> AND Bedrijf.VestType = VestType.VestType ;
> AND &mSeekDosNr ;
> AND &mSeekBedrNm ;
> AND &mSeekHandNm ;
> AND (&mSeekBranch1 ;
> OR &mSeekBranch2 ;
> OR &mSeekBranch3 ;
> OR &mSeekBranch4 ;
> OR &mSeekBranch5) ;
> AND &mSeekStraat ;
> AND &mSeekStatus ;
> AND &mSeekDatIns1 ;
> AND &mSeekDatIns2 ;
>ORDER BY 2 ;
>INTO CURSOR Result
A big part of your problem is the macro expansion. You can get rid of it by using a tool like QBF Builder at
http://www.classycomponents.com. Also, you will want to optimize the query as much as possible. I have an article on my website at
http://www.xmission.com/~craigb
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer