Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vfp 9.0 cursor slow.....

Status
Not open for further replies.

ethanIS

Programmer
Aug 7, 2002
5
0
0
US
I have a project that has been running well in vfp 8.0 for the last 4 years. Today I upgraded to vfp 9.0. Everything seems at this point to work fine except for the creation of my cursors. The below is a sample of one of my cursor creations. It takes .09 seconds in vfp 8.0 and the same code takes 35.75 seconds. The table has 775,000 records in it. Any suggestions resolving this time issue would greatly be appreciated.

Code example:
inspmpt = 'HO_309726'
expirationyear = '2009'

SELECT *;
FROM policyhistory;
WHERE (alltrim(policyhistory.policy) = inspmpt and;
ltrim(str(year(policyhistory.expiration)));
= trim(expirationyear)) or;
alltrim(policyhistory.policy) = inspmpt and;
policyhistory.effective <> { / / } and;
ltrim(str(year(policyhistory.effective)));
= trim(expirationyear));
INTO cursor totalhistoryorg;
order by printdate desc

 
The first thing to check is that CPCurrent() = CPDBF() when you run the query. That is, that you're using the same codepage as when your tables were created.

If that doesn't help, use SYS(3054) to see how VFP is optimizing your query.

Tamar
 
If that does not solve ypur trouble, consider using
Code:
Set enginebehavior 70
to allow VFP work as it did in Version 7.0.
That solves a lot of issues with the "improved" MS-Framework-Visual-Studio-compatible behavior.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top