Alpha Video Training
Results 1 to 10 of 10

Thread: Active Link

  1. #1
    Member
    Real Name
    David Egan
    Join Date
    Jun 2008
    Posts
    16

    Default Active Link

    I'm trying to get my head around how Active Link works and am having a few difficulties, with the concept and how it's supposed to work.
    I have connected to an MSSQL Server database which has brought all my tables in as Active Link tables, all DBF tables with a single record in them which I presume is correct. Using the default form, when I scroll through the records any changes to the data from an external source (eg the main accounting app) which have occurred since the form was loaded aren't reflected in the form unless I hit F5 on the record which has been modified. If I exit the Alpha form and reload it the data is displayed correctly, including any changes made up to the time of loading the form. Any changes I make to the data are written immediately so it seems to be a reading issue. My guess is that Alpha is querying the data out so it's coming from memory, rather than retrieving the record from disk each time. Is that correct?; if so how can I ensure that the detail displayed on my form is current? If not, what am I doing wrong?

    David

  2. #2
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,308

    Default Re: Active Link

    Quote Originally Posted by DJE1 View Post
    I'm trying to get my head around how Active Link works and am having a few difficulties, with the concept and how it's supposed to work.
    I have connected to an MSSQL Server database which has brought all my tables in as Active Link tables, all DBF tables with a single record in them which I presume is correct. Using the default form, when I scroll through the records any changes to the data from an external source (eg the main accounting app) which have occurred since the form was loaded aren't reflected in the form unless I hit F5 on the record which has been modified. If I exit the Alpha form and reload it the data is displayed correctly, including any changes made up to the time of loading the form. Any changes I make to the data are written immediately so it seems to be a reading issue. My guess is that Alpha is querying the data out so it's coming from memory, rather than retrieving the record from disk each time. Is that correct?; if so how can I ensure that the detail displayed on my form is current? If not, what am I doing wrong?

    David
    you are not doing anything wrong.

    when you open an activelink table, a5 queries the backend database and reads the first x records (x is by default set to 50, but you can control the blocksize in the activelink table definition).

    then when you scroll through the records and you get to the end of the first block, a5 goes back to the server and gets the next block of records. this typically happens so fast, that you never notice it happening.

    lets say that you have fetched the first block of records and then some other user updates one of the records that you are currently looking at.

    the data on your screen will NOT automatically update to reflect the changes made by that user (for obvious reasons - it would place a load on the database server and your application would never be able to scale up).

    if you press F5, the current record is refreshed, and if you press Shift+F5 all records are refreshed.

    however, say you don't press F5, but then start editing a record. as soon as you put the record into change mode, the record is immediately refreshed so that you can be sure you are editing the up to date record.

    the way in which a5's active link tables is pretty much how all vendors would design a client/server application.

  3. #3
    Member
    Real Name
    David Egan
    Join Date
    Jun 2008
    Posts
    16

    Default Re: Active Link

    Thanks Selwyn, that all makes sense; I hadn't tried modifying a 'changed' record to see what happened.
    Given that's how it works, is there then a way that we can programmatically refresh the block of records (on a timer for example, ideally based on when that block was read). I'm thinking of the situation where an operator opens the form, looks at a record or 2 and then the phone rings. 5 minutes later they return to the form (or the browse because I imagine the logic is identical) to continue checking records.

    David

  4. #4
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,308

    Default Re: Active Link

    Quote Originally Posted by DJE1 View Post
    Thanks Selwyn, that all makes sense; I hadn't tried modifying a 'changed' record to see what happened.
    Given that's how it works, is there then a way that we can programmatically refresh the block of records (on a timer for example, ideally based on when that block was read). I'm thinking of the situation where an operator opens the form, looks at a record or 2 and then the phone rings. 5 minutes later they return to the form (or the browse because I imagine the logic is identical) to continue checking records.

    David

    just put a timer on the form (form properties dialog - 'form' tab).

    then in the onTimer event, put this code:


    Code:
    topparent.ServerSideRefreshAll()

  5. #5
    "Certified" Alphaholic NoeticCC's Avatar
    Real Name
    Andrea Gill
    Join Date
    Nov 2007
    Location
    Golcar, West Yorkshire, UK
    Posts
    2,070

    Default Re: Active Link

    Another way to do it would be to have a form based on a read only active link table, where you display a list of items (in a browse for example) and have a search box that filters the contents of that browse. Then when you double-click on an item, open a form that is based on an active link table and ONLY retrieves the item in question. That way when you open it it is up to date, and you don't block other users' access to the items you are viewing*.

    *One downside to SQL Server is that some versions lock records even they are just being viewed, until you move to the next item, which can cause problems.

  6. #6
    Member
    Real Name
    Dragan Milosavljevic
    Join Date
    Mar 2010
    Location
    Belgrade, Serbia
    Posts
    79

    Default Re: Active Link

    Mr. Rabins ServerSideRefreshAll () will get all the data from a table on the server. And what to do if there is a some filter in form properties. ServerSideRefreshAll () will ignore that filter on the form and display all data from the table. So my question - is there any way to refresh data on a form which has in the properties defined filter.

  7. #7
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,308

    Default Re: Active Link

    Quote Originally Posted by draganksg View Post
    Mr. Rabins ServerSideRefreshAll () will get all the data from a table on the server. And what to do if there is a some filter in form properties. ServerSideRefreshAll () will ignore that filter on the form and display all data from the table. So my question - is there any way to refresh data on a form which has in the properties defined filter.
    this video shows that the <form>.serverSideRefreshAll() method does not remove the existing filter on the form.

    http://screencast.com/t/UhYYMMgjcZ

  8. #8
    Member
    Real Name
    Dragan Milosavljevic
    Join Date
    Mar 2010
    Location
    Belgrade, Serbia
    Posts
    79

    Default Re: Active Link

    Hi, i's me again and my problem with refreshing link form.

    Obviously I was not clear enough in the previous post. My problem is refreshing the form after entered a new record.The form has declared filter expression in form properties. And it's been ignored when the function serverSideRefreshAll() is been called.The form is based on a set of linked tables. And on link below there is the video that I hope will present a little better my problem.

    http://www.screencast.com/t/E93rVuM2i

  9. #9
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,438

    Default Re: Active Link

    Try the Filter on the Browse instead of the Form.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  10. #10
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,308

    Default Re: Active Link

    I still can't repeat any problem after entering new records.

    I will be happy to take another look at the issue if you build a test case that I can run on my machine.
    Here is what I recommend.
    1. copy alphasports.mdb from the mdbfiles folder in the a5 executable folder to some writable directory
    2. build active link tables on alphasports.mdb
    3. build a form that replicates the issue
    4. send me the app with instructions on how to duplicate the problem.

Similar Threads

  1. Sequences in Active Link tables?
    By NoeticCC in forum Alpha Five Version 9 - Desktop Applications
    Replies: 4
    Last Post: 04-16-2008, 01:53 AM
  2. Active Link error
    By stuartc in forum Alpha Five Version 9 - Desktop Applications
    Replies: 4
    Last Post: 04-10-2008, 08:03 PM
  3. Active Link SQL
    By crimmelcp in forum Alpha Five Version 9 - Desktop Applications
    Replies: 4
    Last Post: 04-09-2008, 11:10 PM
  4. Refresh Active Link
    By andymeer@yahoo.co.uk in forum Alpha Five Version 9 - Desktop Applications
    Replies: 26
    Last Post: 04-05-2008, 11:06 AM
  5. Active link problem
    By Anis in forum Alpha Five Version 9 - Desktop Applications
    Replies: 5
    Last Post: 03-25-2008, 04:00 PM

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
  •