PDA

View Full Version : before upgrading to V9


ABC123

Anis
03-15-2008, 01:54 PM
I'm still interested in the question that I posted with no answer yet.
Is it possible to refresh and see new data in a form or a browse of an active link table without closing them and re-openning.?

If you have a calculated field on a form that shoud consider all records that are being added to MySql database, is there anyway to reflect this on a form that is being viewed without exiting ?

Thanks

Tom Cone Jr
03-15-2008, 02:35 PM
What have you learned during your work with the beta? Are you still talking about an SQL database that's growing at the rate of 15 to 20 records per second, or faster? What do you mean "refresh and see new data"? The last 1000 entered, once a minute? Do the vcr record navigation buttons take you to a new last record if you wait a while for new records to be entered into the SQL table?

Anis
03-15-2008, 02:56 PM
Yes that's part of the issue, if you press vcr you don't see the records that were added to SQL since we first opened the browse.

a simple example is when you have a form that has a quantity field for an account, and orders are coming in for that account, how do you see the quantity field reflecting the total for any records that came in after you opened that form ? F5 doesn't do it

Jim Coltz
03-15-2008, 09:23 PM
Anis, I think I know what you mean. I did a little experiment with build 1369_3159 (I believe the latest) using a simple active linked table against a MySql database. The A5 active link and the MySql table share all the same columns/fields.

I have an auto increment field as the first field in the table.

Upon opening the link in A5 I see all the records in the table. In this case I had three.

I then went to the MySql command line and inserted record number four.

I went back to the still open A5 browse or form and could find no way to see the added record. Refresh, resynch, nada. Even adding a new record from the A5 browse/form will only show the newly added (from A5) record. In other words the A5 browse now show records 1,2,3,5. Record 4 that was added using the MySql command line is no where to be found. I then added for more inserts from the MySql command line and returned to A5 and added one more from there. Now A5 shows records 1,2,3,5,9. A select * from statement run at the MySql command line shows all the records as I would expect.

This all refers to the desktop only. I haven't tried with the WAS.

So... I guess the question is can you use A5V9 in a mixed environment? From what I'm seeing A5 will only work correctly if it is the only source of the transactions.

Want to have some real fun delete some records from the MySql command line and then try to edit them in A5 from an open form that will still show the records as existing. I ended up with a new record being created with only the data that was changed in the record.

Since I have no way of testing V9 with more than one user on the same A5 database I have to assume that the problem I'm seeing in the mixed environment does not exist when A5 is handling all of the transactions and the active linked tables will behave like native DBF tables.

Anis
03-15-2008, 09:35 PM
This is exactly what I'm talking about Jim.
The WAS works fine, because I have been working with it on V8 and didn't have a problem, because this feature actually exists.

I'm just wondering if this will be possible in the future.

Jim Coltz
03-15-2008, 10:52 PM
Updates to the tables via MySql are also strange. If the record that you are updating via MySql happens to be the same record in A5 with a field highlighted in the A5 browse, a refresh of the A5 browse will show the updated record. Any other updates made via MySql on the table are not shown when the A5 browse is refreshed unless you move the highlighting to a field in the record that was updated.

I'm not sure if this is a bug, "feature", or shortcoming. Hopefully Selwyn can shed some light on this.

Selwyn Rabins
03-15-2008, 11:45 PM
I'm still interested in the question that I posted with no answer yet.
Is it possible to refresh and see new data in a form or a browse of an active link table without closing them and re-openning.?

If you have a calculated field on a form that shoud consider all records that are being added to MySql database, is there anyway to reflect this on a form that is being viewed without exiting ?

Thanks

When you open an active link table it does a query on the backend to get the count of the records in the backend table at the time the table is opened.

every time you execute a new server side query, the count query is re-executed.

so by issuing a server side query that returned all records, you would force the active link to reexecute the count query on the server.

a query that returns all records could be:
1=1

so, to answery the question, just execute a server side query of 1=1 and the count query will get re-executed.

Anis
03-16-2008, 12:38 AM
Thanks Selwyn, so I could have a server side query script that runs on a timer of a form and that should update the records to match the sql records ?

Bob Arbuthnot
03-16-2008, 01:30 PM
Anis,

Did Selwyn's query suggestion make it refresh in the manner you wanted?

ba

Anis
03-16-2008, 01:52 PM
I have to find out how to write a script to run a server side query, I'm not sure how to do that yet.
That's the next step.

Jim Coltz
03-16-2008, 05:59 PM
I have to find out how to write a script to run a server side query, I'm not sure how to do that yet.
That's the next step.

This code will run the query on the server for the parent table. For browses based on child tables on forms insert the proper slot number in table.current() or use table.get().



query.filter = "1=1"
query.order = ""
query.options = "S" 'run query on server option, see help files for query_create()

table.current().query_create()

Anis
03-16-2008, 09:05 PM
Thanks Jim;
That actually worked, I put a button on the form and everytime I pressed it it updated the number of records that show at the bottom.

Next I added the script to a timer of 60 seconds and in fact it did update the number of records every minute.

Thanks for everyone's help and special thanks to Selwyn.

Selwyn Rabins
03-17-2008, 11:02 AM
Thanks Jim;
That actually worked, I put a button on the form and everytime I pressed it it updated the number of records that show at the bottom.

Next I added the script to a timer of 60 seconds and in fact it did update the number of records every minute.

Thanks for everyone's help and special thanks to Selwyn.

we just added a new method for forms and browses:

<layout>.ServerSideRefreshAll()

this will re-execute the query for the active-link table that the form or browse is based on.

so if you have a button on a form:

topparent.ServerSideRefreshAll()

this would refresh all rows in the form's active-link table, and any rows added to the serve side table AFTER the form was originally opened, would not be visible to the form.

Anis
03-17-2008, 11:08 AM
That's great.
So if we have a calculated field on the form this should update that with new records from the server.