Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record source - how to speed up manipulation?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01107414
Message ID:
01107441
Vues:
17
>Hi everybody,
>
>Is there any way to speed up retrieval of record source? E.g. I have this code
>
>rs = loConn.Execute(m.ldapStr)
>do while  !rs.eof
>	store "" to lcCN, lcsAMAccountName, lcDepartment, lcEMail
>	oUser = getobject(rs.fields(0).value)
>	lcCN = upper(nvl(m.oUser.cn,""))
>	lcsAMAccountName = upper(nvl(m.oUser.sAMAccountName,""))
>	lcDepartment = upper(nvl(m.oUser.department,""))
>	lcPhoneNo = upper(nvl(m.oUser.telephoneNumber,""))
>	insert into (m.tcCursorName) (cFullName, cuserid, cDepartment, cPhone) ;
>		values (m.lcCN, m.lcsAMAccountName, m.lcDepartment, m.lcPhone)
>	rs.MoveNext()
>enddo
>
>Is where a way to speed it up?
>
>Thanks in advance.

I do not know, but for starters you can move the STORE out of the while loop, doubt it will be of great impact thou, and may be open m.tcCursorName with some alias to avoid the named expresion to be evaluated in the loop?
use (m.tcCursorName) again alias myCursor shared in 0
...
insert into myCursor.....
Anyways, I believe the GetObject is slowing down the execution, so I doubt this would have any impact
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform