Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record source - how to speed up manipulation?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01107414
Message ID:
01107441
Views:
19
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform