Results 1 to 7 of 7

Thread: Virtual Tables and Cursor Adaptors

  1. #1
    Senior Member
    Join Date
    Jan 2014
    Posts
    351

    Virtual Tables and Cursor Adaptors

    Hello

    May I know the difference between Virtual Tables and Cursor Adaptors?

    Are they mutually exclusive meaning I have to decide between which one to use?

    If it is the latter, then how do I decide?

    Your advice is much appreciated

    Thanks & Best Regards

  2. #2
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,840
    Hi Tek Hong,

    When you open a virtual table, you can access its underlying Cursor Adaptor and then the Cursor Adaptor properties and methods.

    e.g.

    Code:
    open database southwind
    use vcust
    ca = cursoradaptor() // specify the alias if not currently selected
    ? ca.selectcmd
    Regards,

    Yvonne

  3. #3
    Senior Member
    Join Date
    Jan 2014
    Posts
    351
    Hi Yvonne

    Do you mean I can actually change the virtual table SQL on the fly?

    Your advice is much appreciated

    Thanks & Best Regards

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,159
    Blog Entries
    22
    Hi Tek Hong,

    Yes.

    ca.requery(" ... ")
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  5. #5
    Senior Member
    Join Date
    Jan 2014
    Posts
    351
    Hi Yvonne

    Is there any documentation that explains the benefit of using cursor adaptor than normal SQL?

    Alternatively, why not just use the table alias directly and the usual VFP data manipulation commands such as APPEND, REPLACE, DELETE?

    Your advice is much appreciated

    Thanks & Best Regards

  6. #6
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,184
    Quote Originally Posted by barrymavin View Post
    Hi Tek Hong,

    Yes.

    ca.requery(" ... ")

    Hi Barry,

    if the new sql adds fields or changes field order will this work in a) non-ui situations and b) where the VT is already showing in a UI component?

    thanks,

    Hank

  7. #7
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,159
    Blog Entries
    22
    ca.requery() replaces the WHERE clause and anything after it e.g. LIMIT or ORDER BY. The select list is in the VT definition.

    If a section has a VT bound to it, a requery() will refresh it's contents. The cursor adaptor knows it has an associated section.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us