VFP Access Data from Cursor Alias

Posted on 2012-09-11
Last Modified: 2012-09-12
I'm trying to figure out how to access data from a cursor alias.
Normally I do this:

Open in new window

and the data is at cursorname.fieldname

I am trying to do this:

lcCursor = "cCursor"

Open in new window

and ALLTRIM(cCursor.fieldname) doesn't work.

maybe it's cause I've been up for nearly 30 hours now that it's not working??
Question by:formadmirer
    LVL 29

    Assisted Solution

    by:Olaf Doschke
    Changing from string literal to a variable containing the cursor name can't be the problem. Simply check lnResult and used(lcCursor) in the first place. If lnResult<0, check for errors. If lnResult=0 check your default setting for asynchronous execution of SQLEXEC.
    If lnResult>0 and Used(lcCursor) is .f., do you really do a SELECT?  Inserts and Updates don't create a result set. Calling stored procs it depends on the return type.

    Bye, Olaf.
    LVL 41

    Accepted Solution

    ALLTRIM(cCursor.fieldname)  must work but
    ALLTRIM(lcCursor.fieldname)  cannot work and you have to use
    ALLTRIM(EVALUATE(lcCursor + ".fieldname"))

    or better

    SELECT (lcCUrsor)

    Author Comment

    Thanks for the help. I just stuck with doing things the way I have done before and works.
    Less work for me too ;)

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: (http://msd…
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now