>*-Browse open tables >PUBLIC loform >loform=CREATEOBJECT("browsetables") >loform.show() >RETURN > > >DEFINE CLASS browsetables AS form > > > DataSession = 2 > Top = 0 > Left = 0 > Height = 424 > Width = 600 > DoCreate = .T. > Caption = "Browse Tables - Please Select a Table to Browse" > ControlBox = .F. > Name = "Form1" > lctable = .F. > > > ADD OBJECT command1 AS commandbutton WITH ; > Top = 12, ; > Left = 423, ; > Height = 36, ; > Width = 84, ; > Picture = "..\..\program files\microsoft visual foxpro 7\wizards\graphics\open.bmp", ; > Caption = "Open Table", ; > TabStop = .F., ; > Name = "Command1" > > > ADD OBJECT grd_view AS grid WITH ; > Height = 324, ; > Left = 12, ; > ReadOnly = .T., ; > RecordSource = "", ; > RecordSourceType = 1, ; > TabStop = .F., ; > Top = 84, ; > Visible = .F., ; > Width = 576, ; > Name = "grd_view" > > > ADD OBJECT lblfilename AS label WITH ; > Caption = "", ; > Height = 24, ; > Left = 13, ; > Top = 51, ; > Width = 348, ; > Name = "lblfilename" > > > ADD OBJECT command2 AS commandbutton WITH ; > Top = 12, ; > Left = 507, ; > Height = 36, ; > Width = 84, ; > Picture = "..\..\program files\microsoft visual foxpro 7\samples\tastrade\bitmaps\close.bmp", ; > Caption = "Exit", ; > TabStop = .F., ; > Name = "Command2" > > > PROCEDURE Release > CLOSE TABLES > DODEFAULT() > ENDPROC > > > PROCEDURE command1.Click > THISFORM.lctable=GETFILE("dbf") > IF !EMPTY(thisform.lctable) > IF USED('gridview') > USE IN gridview > ENDIF > CLOSE TABLES > USE (thisform.lctable) ALIAS mytable > thisform.grd_view.recordsource = "" > *-- run query > SELECT * FROM mytable into cursor gridview > thisform.grd_view.recordsource ="gridview" > thisform.grd_view.visible=.t. > thisform.grd_view.refresh() > USE IN mytable > THISFORM.lblfilename.caption=thisform.lctable > ELSE > THISFORM.grd_view.recordsource="" > thisform.grd_view.visible=.f. > THISFORM.lblfilename.caption="NO table selected" > ENDIF > RETURN > ENDPROC > > > PROCEDURE command2.Click > CLOSE TABLES > THISFORM.RELEASE() > ENDPROC > > >ENDDEFINE >