Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can we input Query in Grid
Message
From
08/01/1999 03:57:48
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
07/01/1999 21:55:51
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00173900
Message ID:
00173934
Views:
35
>We would like to display Table's information (such as customer information) in Grid by using Sele .... cammand (eg. Sele customer.name, customer.add1,.....where customer.state = Thisform.txtbox1.value)which controled condition by textbox. Where 's Sele.... command must store ?
> Thanks for your time.
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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform