>Hi All
>I need to display a grid with real time data, particularly: i have some big tables containing data about phone calls. I want to have a form with one grid in wich some query is run ( at a specific refresh rate of course ), and the result displayed in the grid. What should be the best way to implement this: should i create a parametized view ( i'd like not to, since i'm not very good at those...), or use as rowsource of the grid a SELECT-SQL statement? If i use the latter, how do i populate the columns in the grid, is it by using the field names without the alias? Also, how do i requery this when i want to refresh?
>
>TIA
>Jaime
Hi Jaime
The parameterized view is the most natural choice here. Don't be afraid of it - it is essentially the same as your SELECT-SQL statement (which is your other choice) - you just create it as a view where you put the WHERE condition:
somefield = myVariable
All you will need to do is to have:
myVariable =somevalue
REQUERY("myView")
It is even easier to do when you use the grid, because if you rerun the SQL statement (your grid recordsource is second case) it will rip the source off from under the grid, and you will also need to set recordsource="" before SQL and reset it after (and column control sources too, if you don't use them in the default order).
The view as a Recordsource (type 1-Alias) saves you from all these troubles.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison