Results 1 to 13 of 13

Thread: Browse.view query setting for record selection

  1. #1
    Member
    Real Name
    Mark Gallagher
    Join Date
    Feb 2017
    Location
    Sarasota, Florida
    Posts
    37

    Default Browse.view query setting for record selection

    We use the browse.view function and for everyone else in the shop it is working fine, however, mine is not. When i run a query, i get the records i expect to see, but when i follow the query with a browse.view it selects either the entire table or displays the records from a prior query. This happens weather i'm running my a5 developer or runtime. Some configuraiton parameter must have got reset because i did not have thjis problem last week. Thanks!

  2. #2
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,488

    Default Re: Browse.view query setting for record selection

    If you are using the Query genie to run multiple queries, the Run Query button should pop up a list with several options for the record set to use. Have you used that?
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  3. #3
    Member
    Real Name
    Mark Gallagher
    Join Date
    Feb 2017
    Location
    Sarasota, Florida
    Posts
    37

    Default Re: Browse.view query setting for record selection

    Hi Robin,

    No I do not use that. I switch between ad hoc query and running queries from our forms. Yesterday I was using ad hoc query and it worked fine from my work station in our production database. I was trying to figure out if some setting in ad hoc query was affecting the query I run from the forms we developed and it seemed to have an affect. So maybe some setting in ad hoc query is affecting the form query from my work station. What's even stranger is that I am not having this problem when I log into our test and development system from my workstation. It seems like the production database is "remembering" or "forgetting" something about my workstation.

    Here's an example ... I ran an ad hoc query on a key field using value, lets say AAAAAA in our production system. Then I ran a query from a form using value BBBBBB. When I selected the browse button on the form that makes a call to browse.view the records for value AAAAAA appeared. If I log out of the production system and log back in and run the same form query, when I hit the browse.view button it displays all the records in the database. :(

    I have seen a setting when I use the export table utility. There is a button on the bar labeled "Select Records". I always look at this before doing an export because this will affect if all records are exported or records from the last query are exported. This kinda reminds me of the query issue I'm having. During export A5 will "remember" the last query I did and use this when exporting if I do not select the "All" option.

    Thanks

  4. #4
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,488

    Default Re: Browse.view query setting for record selection

    nt - dupe
    Last edited by MoGrace; 08-31-2018 at 04:46 PM.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  5. #5
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,488

    Default Re: Browse.view query setting for record selection

    I know there is an 'Ad-Hoc Browse' so I am confused when you say 'Ad Hoc Query' as to what you mean. Also is the browse button you are using the one on the system's form toolbar that opens the browse view that switches from form view to browse view? (or using the F8 hot key, or a system menu selection). Or are you using the right click menu when a field is selected on a form, where there is an option for Quick Filter. If that is what you are using to filter by a field value then using the F8 key (or toolbar button or menu option) it should switch you to the default browse view using that same query.

    browseview.png
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  6. #6
    Member
    Real Name
    Mark Gallagher
    Join Date
    Feb 2017
    Location
    Sarasota, Florida
    Posts
    37

    Default Re: Browse.view query setting for record selection

    Yes, it is called "Ad Hoc Browse", sorry for the confusion.

    We do not use the browse button on the system's form tool bar or the F8 hot key.

    We use forms developed in house that have a browse button coded into them. When the browse button is selected (OnPush) the following code executes …

    ***************************************************************************
    DIM SHARED SP10 AS P 'Define shared browse window pointer

    if (IS_OBJECT(SP10)) then 'Close Browse window only if one exists
    SP10.close() 'This prevents multiple browse windows
    end if

    SP10 = Browse.view("Browse10@pop records") 'Open browse window, initialize SP10
    *********************************************************************************

    The Browse.view call selects the browse program name(Browse10) and the table name(pop records) to browse. The records selected are based
    on the most recent query that the form executes.

  7. #7
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,488

    Default Re: Browse.view query setting for record selection

    Since your browse has a name I assume you have saved it to the control panel. If that is the case then you can set that named 'companion browse' in the form's properties (browse must be based on the same table or set the form is using else it won't appear in the select list). Then in the browse properties, do the same and select your form name. Now the user can use the F8 hotkey or the toolbar button to toggle between them and that default action will not open a duplicate instance of the browse. If you want to keep your button, just have it send_keys("{F8}".

    Right now your button script will drop the form's query if the browse is already open. Whereas the built in toggle function will always find the selection. Your current script is not doing anything to link the browse to the current record nor does it run a query in the browse.

    If you want to have both the form and the browse open at the same time your button script will have to get a pointer to the current record or query before activating or opening the browse to either find the record or create a query filter.

    So when you say 'Ad Hoc Browse' is the user creating this browse (selecting the fields, query etc.) each time they want to see it?
    Last edited by MoGrace; 09-05-2018 at 03:10 PM.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  8. #8
    Member
    Real Name
    Mark Gallagher
    Join Date
    Feb 2017
    Location
    Sarasota, Florida
    Posts
    37

    Default Re: Browse.view query setting for record selection

    We do not use 'Ad Hoc Browse' on a regular basis, we use forms developed in house for queries and/or browses.

    Looking at the properties of the browse program, I did find the configuration parameter that explains how our browse program works with our forms that do the queries that I have been looking for, so thanks for bringing up properties.

    There is a browse property tab called 'Filter/Order' and a check box for 'Use the last run query' that is selected. So when I run a query with our form, then select the browse button that executes the code you see above in a prior thread, the Browse.view function uses the last run query performed by the form as its filter. This is where my workstation fails. It selects all the records from the table which is the default behavior of browse.view if the 'use the last run query' box is not selected in the 'Filter/Order' tab found in the properties tab.

    I could not find the parameter in the form or browse properties to configure a 'companion browse' or 'companion form'.

  9. #9
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Browse.view query setting for record selection

    Image 33.png

    Image 34.png

    The information about "Last run query" (actually the last 4 queries are available) for each table (dmgrecl.dbf in this example) is stored in the Windows registry under a key named (for V11)

    HKEY_CURRENT_USER\Software\Alpha Software\Alpha Five 11.0\INDX\FFFF01D5-DMGRECL.DBF;1

    the details of the query itself are stored in a file which can be found under that key

    FILE=~C:\Alpha\privpath\$$101E01.MPX~ DESC=~Temporary Query~

    The location of that file is determined by the Alpha Settings, Directories, private path specified.

    private path.png

    If your workstation isn't honoring the last run query there may be something wrong with the registry or the private path setting.
    Last edited by Stan Mathews; 09-06-2018 at 04:20 PM.
    There can be only one.

  10. #10
    Member
    Real Name
    Mark Gallagher
    Join Date
    Feb 2017
    Location
    Sarasota, Florida
    Posts
    37

    Default Re: Browse.view query setting for record selection

    Hi Stan -

    This is a lot of great info about the W10 registry and A5 ... so I edited mine and deleted keys INDX and Table since as far as I could tell just held temporary and work areas about the database tables. I really thought this was going to fix the problem, but it did not. I can also see the *.MPX files in my Windows temporary file folder (%TEMP%).


    I'm going to keep looking at the registry, but I may just re-install my A5 Client and see if that fixes the problem.


    Thanks!

  11. #11
    Member
    Real Name
    Mark Gallagher
    Join Date
    Feb 2017
    Location
    Sarasota, Florida
    Posts
    37

    Default Re: Browse.view query setting for record selection

    Hi Robin and Stan,

    I figured out what the problem is ...

    Everyone accesses our production system from the "J" drive mapped on their PC's with a local copy of A5 Runtime installed.

    My PC is the ONLY one that has both the test & development system(mapped as "M") and the production system(mapped as "J").

    I recently updated our main menu form using the tst/dev system and moved it to the production system along with a bunch of other modifications.
    During one of my troubleshooting sessions I disconnected my tst/dev "M" drive and things started working correctly in the production system for me.

    I took a closer look at the main menu form and when you select(onpush) a button two actions are performed

    1) close the current form
    2) open another form

    I noticed that the location of the form to be opened was still pointing to the "M" drive to locate the *.DDD files. For some reason
    it is not using a relative file pathname. So A5 does not find an "M" drive on everyone else's PC but continues looking for
    the *.DDD files in their current folder or "J" drive and continues to operate correctly. On my PC it finds the "M" drive and starts
    using objects from the tst/dev *.DDD files ... oops!

    So I think it is interesting that Alpha 5 did not give the users an error when it could not find the "M:\*.ddd" files but continued to look for them on the "J" drive.

    What could I have done to the main menu form that caused it to use a hard coded drive location for the forms selected?

    Thanks ... Mark

  12. #12
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,488

    Default Re: Browse.view query setting for record selection

    Hi Mark,
    You still might want to reverse the closing of the current form and opening of the new form, so you open the other form first.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  13. #13
    Member
    Real Name
    Mark Gallagher
    Join Date
    Feb 2017
    Location
    Sarasota, Florida
    Posts
    37

    Default Re: Browse.view query setting for record selection

    Hi Robin,

    Here's an attached screen shot of what is causing my problem. My DEV/TST system is on the "M:" drive. My production system is on the "J:" drive. If I have both the M drive and the J drive mapped, I have the above described problem. If I disconnect the M drive my problem goes away.

    Capture.JPG

    I did my development on the M Drive and this drive code followed the form into production. Users without an M drive do not experience a problem because Alpha 5 ignores the M drive reference and finds all its objects on the users J drive.

    When a layout is exported I would think that Alpha 5 would drop the hard coded drive references and look in the current or relative folder for its objects, which it is kind of doing by ignoring the hard coded J drive reference.

Similar Threads

  1. setting browse record when form opens
    By gmeredith17 in forum Alpha Five Version 7
    Replies: 11
    Last Post: 04-19-2007, 03:04 PM
  2. Setting focus on last record in browse
    By salah in forum Alpha Five Version 7
    Replies: 4
    Last Post: 12-08-2005, 07:38 AM
  3. Layout Selection - BROWSE/VIEW Problem
    By Joseph Bizik in forum Alpha Five Version 4
    Replies: 2
    Last Post: 11-11-2002, 04:21 AM
  4. Browse Record View
    By Peter.Greulich in forum Alpha Five Version 4
    Replies: 14
    Last Post: 10-08-2001, 08:15 AM
  5. Buttons (ie:view record) on a Browse? HOW?
    By Rich Williams in forum Alpha Five Version 4
    Replies: 5
    Last Post: 04-24-2000, 09:45 AM

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
  •