I wondered about the name "Attend" as well, but it doesn't appear to be a reserved word - at least up to VFP6 - maybe it is in VFP7.
Glad you got it fixed.
>I don't
THINK I have an 'Attend' object. I originally used 'Attenders' as the cursor name - but that acted the same way. I found that changing the curso name to 'something completely different' (TQuery1) solved the problem - perhaps it was an object name collision, or maybe I stmbled onto a SQL reserved word or something.
>
>Thanks for the help.
>
>>>Argh!
>>>
>>>I'm using VFP7. I'm creating a cursor, then trying to use it again in a SELECT:
>>>
>>>
CREATE CURSOR Attend (Attender C(8))
>>* space added above
>>>
>>>FOR i=1 TO lnVars
>>> INSERT INTO Attend (Attender) VALUES (laAttenders[i])
>> * spaces added above
>> * could look at APPEND FROM ARRAY instead
>>>ENDFOR
>>>
>>>This does indeed create a cursor, with several records - but then:
>>>
>>>
>>>SELECT Attend.*, SchedContribs.UserCode, RECNO('SchedContribs') AS Recordnum ;
>>> FROM Attend ;
>>> OUTER JOIN Extranet\SchedContribs ;
>>> ON Attend.Attender=SchedContribs.UserCode ;
>>> WHERE SchedCode=lcSchedCode ;
>>> INTO CURSOR TQuery
>>>
>>>
>>>Reports: "Alias 'ATTEND' is not found." - Even though my data environment clearly shows a workarea with that name (which I can browse). I've tried using DBF('Attend') instead, with the same results.
>>>
>>>Any ideas?
>>>
>>>TIA
>>
>>Added spaces in first section
>>
>>Removed leading ".\" from OUTER JOIN line - not necessary
>>
>>As Craig pointed out RECNO() is unreliable in this usage - you should have a primary or candidate key you could use instead.
>>
>>You don't happen to have an object called "Attend" within scope when you run this, do you?
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up