Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rushmore Speed Problem
Message
 
À
13/10/2009 15:59:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01429151
Message ID:
01429475
Vues:
50
Thanks!

>Try defering the execution of the SQL Select statement until you have, say, the first three letters. This will provide them with a smaller subset, but it will load faster. Also, the number of letters in the Combobox becomes less then three, clear the list.
>
>Here is an example. The actual code is in the KeyPress event.
>
>
>PUBLIC oform1
>
>oform1=NEWOBJECT("form1")
>oform1.Show
>RETURN
>
>
>	**************************************************
>*-- Form:         form1 (c:\program files\microsoft visual foxpro 9\cbx.scx)
>*
>DEFINE CLASS form1 AS form
>
>
>	DoCreate = .T.
>	Caption = "Form1"
>	Name = "Form1"
>
>
>	ADD OBJECT combo1 AS combobox WITH ;
>		RowSourceType = 3, ;
>		Height = 24, ;
>		IncrementalSearch = .T., ;
>		Left = 24, ;
>		Top = 24, ;
>		Width = 264, ;
>		Name = "Combo1"
>
>
>	PROCEDURE combo1.KeyPress
>		LPARAMETERS nKeyCode, nShiftAltCtrl
>
>		*-- make sure the key stroke get there first.
>		DODEFAULT( nKeyCode, nShiftAltCtrl)
>		NODEFAULT
>
>		DO CASE 
>		CASE LEN(ALLTRIM(this.DisplayValue))<3
>			*-- clear set
>			this.RowSource=""
>
>		case LEN(ALLTRIM(this.DisplayValue))=3
>			*-- generate new sub-set
>			this.RowSourceType= 3		&& SQL
>			this.RowSource="Select Name from Customer where upper(LEFT(name,3))='" + ALLTRIM(this.DisplayValue)+"' and not DELETED() order by Name INTO CURSOR qtemp"
>
>		OTHERWISE
>			*-- keep current set
>		ENDcase 
>
>
>	ENDPROC
>
>
>ENDDEFINE
>*
>*-- EndDefine: form1
>**************************************************
>
>
>>Hi Gang!
>>
>>I have a form which has a combobox that I want to populate from a field from a table called REGTRANS. The field is PTNT_NAME (C-30).
>>
>>In the LOAD of the form, I have this code....
>>
>>
>>*!*	*Create data for the patient Name combobox
>>SELECT DISTINCT ptnt_name FROM regtrans WHERE DELETED() = .F. INTO CURSOR csr_names ORDER BY ptnt_name
>>
>>
>>I have an index in REGTRANS called DELETED which is indexed on DELETED().
>>The form has SET DELETED ON.
>>
>>For the combobox, here are the DATA properties...
>>
>>CONTROLSOURCE     csr_names
>>ROWSOURCE            csr_names.ptnt_name
>>ROWSOURCETYPE    2 - ALIAS
>>VALUE                       ""
>>
>>
>>When I bring up the form, the SELECT statement takes about 35 seconds to populate the combobox....
>>
>>REGTRANS has 2,693,163 records and the SELECT statement pulls out 244,799 recods (for the combobox). When form comes up, the combobox works fine (very responsive and I can do the Incremental Search.
>>
>>It just takes TOO DANG LONG to come up!!!
>>
>>Does anyone see anything wrong in how I set this up (Rushmore????).
>>
>>Thanks!
Tommy Tillman A+ NetWork+ MCP
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform