Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Build a grid on the fly
Message
From
26/07/1999 02:45:24
 
 
To
25/07/1999 18:29:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00245910
Message ID:
00245964
Views:
13
>I need to open a table that is selected with GETFILE() and set a grid to display it for raw editing of the data. I can't seem to find the magic syntax to display the file seleced in the grid. So far I am trying the following but the table does not show up in the grid... Any ideas??
>
>WITH ThisForm
> .cTable = GETFILE("DBF", "Select a Table", "Open", 0, ;
> "Open a Table to Edit")
>
> IF NOT EMPTY(.cTable)
> USE (.cTable) AGAIN IN 0 ORDER BY 1 ALIAS gGrdTable Shared
> SELECT (.cTable)
> CursorSetProp("Buffer", 5, "gGrdTable")
> .grdEditTable.ColumnCount = -1
> .grdEditTable.RecordSource = gGrdTable
> .grdEditTable.Refresh()
> ENDIF
>ENDWITH
>
>
>Thanks




Hi all.
as previous ppl said, some wrong thing has been pointed out!!

What I want to highlight:

- make the table opened shared, i.e. allow other can open it and allow SAME application can open table twice (AGAIN)!!
- set a basic order, (Order By 1) the Topic default order, as you MUST need the data show orderly!!





Now, I would give you a better case to study!!
Visit File Section, and download the bwtable.zip in Form section.

Browse Table does what you want and GIVE more additional features to you.

- Change grd.Recordsource in Run-Time, so that you can browse another table after change the cobox Table.
- Fix the VFP 5.0 Ime known bug (open IME windows always in every textbox)
- Order the table in Run-Time, so that you can search table in different according to the order tag.
- Search including Forward search on simply one field condition. (e.g. [abc]$field, locate field with abc text in middle)
- SQL Filter the same above Condition by RightClick Search (but result is a READ-ONLY cursor)
- Add record with Buffer mode 5 setting, (i.e. you can choose "Cancel Add") to ignore add.
- Update record as you can run it more than one times, (update for multi-open in same table!!)
- Set Desire Field to show to make you easiler to edit the table, (may have some bugs but can captured)

Although I haven't given much comment on coding, but I think it is not hard to study for beginner!

You can simply copy the bwtable.exe to a directory which has some dbf there.
Then, you will see how it works!


p.s. for more information on bwtable, you can see the readme file or email me!
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Reply
Map
View

Click here to load this message in the networking platform