Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get a list of tables in a database into an array

Status
Not open for further replies.

jworley

Programmer
Jun 19, 2000
36
GB
Hi,

Please forgive me if this question is a little elementary but I have searched this forum for ages and I haven't found anything on this subject.

I am writing a query form where a user can locate and open any VFP database. What I would then like to do is get a list of tables in that database (Such as the output from DISPLAY TABLES) and populate a list box with that table list, the idea being that the user can select the table they want to open.

Having selected the table, it would be great if the list also allowed the selection of the fields within the selected table, i.e. a tree display maybe with appropriate icons. I am assuming I would need the table list in an array as well as the field list. Any help would be greatly appreciated.

Regards

Jim Worley
jim@aits-uk.net
 
jworley

Code:
Public Array aTables[1]
oData = Getfile('dbc')
Set Default To Justpath(oData)
Open Database (oData)  Exclusive
Set  Database To (oData)
m.latables  = Adbobjects(aTables, 'Table')

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top