Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem creating cursor
Message
De
20/04/2003 18:55:12
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00779629
Message ID:
00779649
Vues:
12
Sergey - Good guess - that is exactly what it is. The first query the target table was not indexed on Policy_no and the second query which was the problematic one had an index on policy_no.

Sergey with all your knowledge you should write a tips and tricks book and highlight stuff like this. I have never run across this before and I have been using Fox and VFP for years.

Thanks greatly.
Gaylen,
>
>My guess is that VFP creates "filtered cursor". It may happend if condition in WHERE clause is Rushmore optimizable. That would explain why you didn't get an error with another table. The filter expression gets evaluated when record poiner is moved in the cursor. At that point it's running outside of form, so it cannot reference it with THISFORM. If you use local variable it goes out of the scope at this point. To force VFP to create persistent cursor add NOFILTER CLAUSE to the query.
Select * From deposits;
>  WHERE policy_no = thisform.lnPolicyNo AND BETWEEN (dep_date,ldbegindate,ldenddate);
>  Into cursor depositdetail NOFILTER
>
>>I am getting an error message using the following code
>>
>>
>>Select * From deposits;
>>WHERE policy_no = thisform.lnPolicyNo AND BETWEEN (dep_date,ldbegindate,ldenddate);
>>	 Into cursor depositdetail
>>
>>
>>
>>After the cursor is created and I try to view it in the data session menu option an error message comes up and says 'object is not contained in a form'. Instead of using a form property, I tried using a variable in the where clause and named it "lnPolicyNo" and I get an error message about can't find variable "lnPolicyNo".
>>
>>Interestingly in the same method I created another cursor from another table and used the same variables in the where clause and did not have a problem with it.
>>
>>Any ideas on what is happening.
>>
>>Gaylen
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform