Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid With Query or View
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00659339
Message ID:
00660388
Views:
8
>hi Nick...
>
>Here's my problem...
>there're several but i hope you can help me one or more of it
>1. Grid usually use recorsource from a table....
> but i want the grid is base on a view or a query..
> of course it's can be updateable like table did..
>
>2. If You handling a mighty giant records let's talk about 20 milyun records
> and how do you filter or locate the records it self of course with the
> maximum search in time.... Between Seek, Locate, Or Query which is the
> best search...
>
>3. I used an array an could you help me how if i wanna know how many records
> in the array has been fill up to the array..
> May be i sentence rather complicated but i hope u know what i mean...
>
>4. that's all thanks....
>
>
>regards,
>tut_arie

I think the best way here will be to use the parameterized updatable view as a grid.RecordSource.
Basically, you create the desired view in View Designer (or programmatically, if the view is more complicated). There you set your parameter condition (one or more) in Filter tab, something like:
myField1 = myVariable && that will be your view parameter
Mark the key field (your primary key in the table) and updatable fields in Update Criteria tab and check Send Updates checkbox.

Set
Grid.RecordSource = 1- Alias
Grid.RecordSource = yourViewName

When you need to refresh the data in the grid you just do
myVariable = somevalue
REQUERY("yourViewName")
Thisform.Grid.Refresh()
You may also set
NoDataOnLoad = .t.
for your view cursor in Form Dataenvironment, so you will refresh your grid only when you have the desired view parameter value set.

To update the data in the view you will need to issue TABLEUPDATE("yourViewName"). the exact parameters for your TABLEUPDATE() function call will depend on which type of buffering you need for your view.

This is just general approach, you can tweak it depending on your situation.
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
Previous
Reply
Map
View

Click here to load this message in the networking platform