Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can we input Query in Grid
Message
From
10/01/1999 05:00:34
 
 
To
08/01/1999 03:57:48
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00173900
Message ID:
00174466
Views:
27
Dear sir,
Thanks for your sample. It is very great for me. But I have some
questions to ask you about your sample, Can that command update Table ?
Because after I put that sample, I cannot update any data in Grid.
So, I must use "set filter" instead that but it 's take so long because
my table have more than 7000 recs.
So we would like you to suggest me that which command better than
"set filter" my codes is :
mytextbox.valid
sele customer
set filter to state=this.value
mygrid.refresh

Thanks again for your suggestion
Best regard,
NO.

>No,
>If you're talking about noneditable grid, then SQL would be the "recordsource" of grid and "recordsourcetype" would be 4-SQL. Then grid refresh is only needed call to get updated data. You can set it in form.init, grid.init, directly on grid's PEM sheet etc. Be sure you table is already indexed on state (or any other expression contained in where). Pls notice that all SQL is quoted :
* Form.init
>with thisform.mygrid
>  .recordsourcetype = 4
>  .recordsource = [Sele customer.name, customer.add1,..... ]+;
>                  [ where customer.state = Thisform.txtbox1.value ]+;
>                  [into cursor crsMyGrid]
>endwith
>* txtBox1.lostfocus
>thisform.mygrid.refresh
You don't even need setting columns in design mode if you don't want special format and columncount. Just drop the grid and size itself.
with thisform.mygrid
>  .columncount = -1
>  .recordsourcetype = 4
>  .recordsource = [Sele customer.name, customer.add1,..... ]+;
>                  [ where customer.state = Thisform.txtbox1.value ]+;
>                  [into cursor crsMyGrid]
>endwith
If you put this code in a custom method you could send SQL as a parameter to change info on the fly :)
>Cetin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform